Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
JelteDeJong
in reply to: jingying_1213

The method "GetTemplateFile" will not make a weldment document but will just point to the weldment template. Therefore you need to check that your template is a weldment template. Therefore you could add a message box and look if the method really points to a weldment assembly.

        Dim oWeldment As String = "{28EC8354-9024-440F-A8A2-0E0E55D635B0}"

        Dim oDocs As Documents = ThisApplication.Documents
        Dim oTemplateFile As String = ThisApplication.FileManager.GetTemplateFile(DocumentTypeEnum.kAssemblyDocumentObject,
            SystemOfMeasureEnum.kDefaultSystemOfMeasure, DraftingStandardEnum.kDefault_DraftingStandard, oWeldment)

        MsgBox(oTemplateFile)

        Dim oADoc As Document = oDocs.Add( DocumentTypeEnum.kAssemblyDocumentObject, oTemplateFile, True)

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com