Code:
Dim bohrung1 As Hole
Dim catSmoothHoleThreading As CatHoleThreadingMode
Dim catCounterboredHole As CatHoleType
Dim catTrimmedHoleBottom As CatHoleBottomType
Dim catUpThruNextLimit As CatLimitMode
Dim catExtremPointHoleAnchor As CatHoleAnchorMode
Dim length1 As Length
Dim length2 As Length
Dim length3 As Length
Dim parameters1 As Parameters
Dim parameters2 As Parameters
Dim catRightThreadSide As CatHoleThreadSide
Dim catFlatHoleBottom As CatHoleBottomType
Dim catOffsetLimit As CatLimitMode
Dim limit2 As Limit
Dim catSimpleHole As CatHoleType
Dim length4 As Length MyPart.InWorkObject = Body1
'##### Bohrung freisetzen und Beziehung nachträglich setzen
bohrung1 = Shapefactory1.AddNewHoleFromPoint(P1xyz(0), P1xyz(1), P1xyz(2), ref1, 10)
Sketch1 = bohrung1.Sketch
Sketch1.OpenEdition()
Dim stern As Point2D
stern = Sketch1.GeometricElements.Item(2)
'##### Stern verschieben
stern.SetData(-10, -10)
Sketch1.CloseEdition()
MyPart.Update()
bohrung1.Type = catSimpleHole
bohrung1.AnchorMode = catExtremPointHoleAnchor
bohrung1.BottomType = catFlatHoleBottom
limit2 = bohrung1.BottomLimit
limit2.LimitMode = catOffsetLimit
length2 = bohrung1.Diameter
length2.Value = 10.0
bohrung1.ThreadingMode = catSmoothHoleThreading
bohrung1.ThreadSide = catRightThreadSide
bohrung1.BottomType = catTrimmedHoleBottom
limit2.LimitMode = catUpThruNextLimit
bohrung1.Type = catCounterboredHole
parameters1 = MyPart.Parameters
' length3 = parameters1.Item("part1\Hauptkörper\Bohrung.1\HoleCounterBoredType.1\Durchmesser")
'length3.Value = 15.0
'parameters2 = MyPart.Parameters
'length4 = parameters2.Item("part1\Hauptkörper\Bohrung.1\HoleCounterBoredType.1\Tiefe")
'length4.Value = 5.0
'length2.Value = 12.0
'length4.Value = 7.5
MyPart.Update()