Weld - XML Info

Weld - XML Info

Anonymous
Not applicable
514 Views
1 Reply
Message 1 of 2

Weld - XML Info

Anonymous
Not applicable

Hi guys,

 

I tried to get the XML-Information of a weld. But the string that should contain this information is empty. Did I make a mistake?, or is this feature not supported by Inventor 2014 anymore. Even the helping page "More XML Weld Info..." in the Programmershelp doesn't exist anymore and leads to an error.

 

This is my VBA-Code to show the XML-Info string for each weld within the assembly in a message box:

 

Sub WeldInfo()
    'is the active document an assembly?
    If ThisApplication.ActiveDocument.DocumentType <> DocumentTypeEnum.kAssemblyDocumentObject Then
        Return
    End If
    Dim IamDoc As AssemblyDocument
    Set IamDoc = ThisApplication.ActiveDocument
    
    Dim ComDef As AssemblyComponentDefinition
    Set ComDef = IamDoc.ComponentDefinition
    
    Dim ComOccS As ComponentOccurrences
    Set ComOccS = ComDef.Occurrences

    Dim ComOcc As ComponentOccurrence

    For Each ComOcc In ComOccS
        If ComOcc.Type = ObjectTypeEnum.kComponentOccurrenceObject Then
            Dim Def As ComponentDefinition
            Set Def = ComOcc.Definition
            
            'If the occurence is a weld
            If Def.Type = ObjectTypeEnum.kWeldsComponentDefinitionObject Then
                Dim WelComDef As WeldmentComponentDefinition
                Set WelComDef = ComDef
                Dim WelS As Welds
                Set WelS = WelComDef.Welds
                
                Dim WelBeaS As WeldBeads
                Set WelBeaS = WelS.WeldBeads
                
                'For each WeldBead display the XML-Information
                Dim WelBea As WeldBead
                    For Each WelBea In WelBeaS
                    
                    'Display the XML String
                    MsgBox ("name: " & WelBea.Name & " XML-Info: " & WelBea.WeldInfo)
                    
                    Next
                    MsgBox ("finished")
            End If
        End If
    Next
End Sub

 

For Your help I would be grateful

0 Likes
Accepted solutions (1)
515 Views
1 Reply
Reply (1)
Message 2 of 2

Anonymous
Not applicable
Accepted solution

I found the solution. The XML-Info String only provides the Information of the weld symbol. So you have to add a weld symbol to the weld first. Then you can read the XML-String.

0 Likes