Code:
'Fügt in ein geöffnetes Part ein Geometrisches Set, einen Sketch und einen Punkt ein.
Option ExplicitSub CATMain()
Dim oDoc As Document
Dim oPart As Part
Dim body1 As Body
Dim Sketches1 As Sketches
Dim reference1 As Reference
Dim Sketch1 'As Sketch
Dim arrayOfVariantOfDouble1(8)
Dim factory2D1 As Factory2D
Dim o2DFactory 'As Factory2D
Dim oPoint2D As Point2D
Dim oTargetPart As PartDocument
Dim HybridShapeFactory1 As HybridShapeFactory
Dim HybridBodies1 As HybridBodies
Dim oGeoset
Dim HybridShapePointCoord1 As HybridShapePointCoord
Set oDoc = CATIA.ActiveDocument
Set oPart = oDoc.Part ' aktives part holen
Set HybridShapeFactory1 = oPart.HybridShapeFactory
Set HybridBodies1 = oPart.HybridBodies
Set oGeoset = HybridBodies1.Add
oGeoset.Name = "Generated Set.1"
Set HybridShapeFactory1 = oPart.HybridShapeFactory
Set HybridShapePointCoord1 = HybridShapeFactory1.AddNewPointCoord(5, 7, 11)
oGeoset.AppendHybridShape HybridShapePointCoord1
hybridShapePointCoord1.Name = "Generated Point.1"
Set Body1 = oPart.MainBody
' Set Sketches1 = HybridShapeFactory1.Sketches
Set Sketches1 = Body1.Sketches
Set Reference1 = oPart.OriginElements.PlaneXY
Set Sketch1 = Sketches1.Add(reference1)
Sketch1.Name = "Generated Sketch.1"
oPart.InWorkObject = Sketch1
Set factory2D1 = Sketch1.OpenEdition()
Set o2DFactory = Sketch1.Factory2D
Set oPoint2D = o2DFactory.CreatePoint(10, 22)
Sketch1.CloseEdition
oPart.Update
End Sub