Message 1 of 2

Not applicable
01-06-2014
08:23 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
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
Solved! Go to Solution.