Results 1 to 2 of 2
  1. #1

    Creo VB API - Create new Part

    Hello,

    i would create a new part using the default Template. Next Step ist to save the part.

    Code:
    Dim Session As pfcls.IpfcSession = AsyncConnection.Session
    Dim BaseSession As pfcls.IpfcBaseSession = CType(session, pfcls.IpfcBaseSession)
    Dim MyDocumentsPath As String = System.IO.Path.Combine(System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
    Dim WorkingDirectory As String = System.IO.Path.Combine(MyDocumentsPath, "CreoTest")
    If System.IO.Directory.Exists(WorkingDirectory) = False Then System.IO.Directory.CreateDirectory(WorkingDirectory)
    'set working directory
    BaseSession.ChangeDirectory(WorkingDirectory)
    'create new part
    Dim Part As pfcls.IpfcPart = BaseSession.CreatePart(_Name:=NewPartName)
    Dim Model As pfcls.IpfcModel = CType(Part, pfcls.IpfcModel)
    'save part to working directory
    Model.Save()
    'display new part
    Model.Display()
    If I do it in this way, the part ist displayd in Creo, but it ist inactive. The ribbons are grayed and the feature tree ist not displayed. How kann i change this issue.

  2. #2

    blamed Lomachenko's defeat to Salido on him being


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •