Hallo zusammen,
wir wollen ein Makro schreiben, damit wir eine Kontur vervielfältigen können und diese in einem bestimmten Winkel an einer Helix läuft! 
Das ist unser text:
Dim CATIA As INFITF.Application
        Dim Body1 As Body
        Dim part1 As Part
        Dim hybridBody1 As Body
        Dim reference1, reference2 As Reference
        Dim hybridBodies1 As Bodies
        Dim hybridShapeFactory1 As HybridShapeFactory
        Dim hybridShapes1 As HybridShape
        Dim hybridShapeRotate1 As HybridShapeRotate
        Dim partDocument1 As Document
        Dim hybridShapeAssemble1 As HybridShapeAssemble
        Dim axisSystems1 As AxisSystems
        Dim axisSystem1 As AxisSystem
        Dim bodies1 As Bodies
        Try
            CATIA = System.Runtime.InteropServices.Marshal.GetActiveObject("CATIA.Application")
        Catch ex As System.Runtime.InteropServices.COMException
            MessageBox.Show("Catia nicht gefunden!", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error)
            End
        End Try
        partDocument1 = CATIA.ActiveDocument
        part1 = partDocument1.Part
        hybridShapeFactory1 = part1.HybridShapeFactory
        hybridShapeRotate1 = hybridShapeFactory1.AddNewEmptyRotate()
        hybridBodies1 = part1.HybridBodies
        hybridBody1 = hybridBodies1.Item("Kurve_1")
        hybridShapes1 = hybridBody1.HybridShapes
        hybridShapeAssemble1 = hybridShapes1.Item("Verbindung.3")
        reference1 = part1.CreateReferenceFromObject(hybridShapeAssemble1)
        hybridShapeRotate1.ElemToRotate = reference1
        hybridShapeRotate1.VolumeResult = False
        hybridShapeRotate1.RotationType = 0
        axisSystems1 = part1.AxisSystems
        axisSystem1 = axisSystems1.Item("Achsensystem.1")
        reference2 = part1.CreateReferenceFromBRepName("REdge 
Edge 
Face 
Brp 
AxisSystem.1;3);None 
);Cf11 
));Face 
Brp 
AxisSystem.1;2);None 
);Cf11 
));None 
Limits1 
);Limits2 
));Cf11 
));WithPe rmanentBody;WithoutBuildError;WithSelectingFeatureSupport;MFBRepVersion_CXR15)", axisSystem1)
        hybridShapeRotate1.Axis = reference2
        hybridShapeRotate1.AngleValue = 42.2
        bodies1 = part1.Bodies
        body1 = bodies1.Item("Hauptkörper")
        body1.InsertHybridShape(hybridShapeRotate1)
        part1.InWorkObject = hybridShapeRotate1
        part1.Update()
Das Problem liegt bei der Kurve1!! Wenn wir Visual starten findet er die Kurve1 nicht!!!!
Kann mir da jemand weiterhelfen???
Eine Antwort auf diesen Beitrag verfassen (mit Zitat/Zitat des Beitrags) IP