Create a new file

This function create a new  “3DShape” and assign the according window to a variable [Typ: Window]. The variables “MyEditor” and “MyPart” are assigned to the new editor and the new part.

Public Function CreateNewFileAndSetWindow(ByRef MyEditor As Editor, ByRef MyPart As Part) As Window
    Dim MyService As PLMNewService
    
    Set MyService = CATIA.GetSessionService("PLMNewService")
    MyService.PLMCreate "3DShape", MyEditor
    Set CreateNewFileAndSetWindow = CATIA.ActiveWindow
    Set MyPart = MyEditor.ActiveObject    
End Function

 

Leave a Reply

Your email address will not be published. Required fields are marked *

− 1 = 2