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

I get the same error with the code you just sent, traced it to this line:

 

Sub Main()
    Dim oCD As ComponentDefinition
    
    For Each oSubDoc in ThisDoc.Document.AllReferencedDocuments
        If oSubDoc.DocumentType = kAssemblyDocumentObject 'AssemblyDocument
            If oSubDoc.ComponentDefinition.Type = ObjectTypeEnum.kWeldmentComponentDefinitionObject
'                'Dim oWCD As WeldmentComponentDefinition = oSubDoc.ComponentDefinition
'                'oCD = oWCD
'                'MsgBox(oWCD.Document.FullFileName)
'                'Goto Continue1
'            Else
'                Dim oACD As AssemblyComponentDefinition = oSubDoc.ComponentDefinition
'                oCD = oACD
'            End If
'        Else 'Part Doc
'            If oSubDoc.ComponentDefinition.Type = ObjectTypeEnum.kSheetMetalComponentDefinitionObject
'                Dim oSCD As SheetMetalComponentDefinition = oSubDoc.ComponentDefinition
'                oCD = oSCD
'            Else
'                Dim oPCD As PartComponentDefinition = oSubDoc.ComponentDefinition
'                oCD = oPCD
            End If
        End If
    Next
    
'Continue1:
    'MsgBox(oCD.Document.FullFileName)

End Sub