Message 1 of 5
For each in sub assembly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I am unable to have all parts and sub-assembly as objects in an assembly.
see code. I always get a wood notification on the 2nd For Each.
can anyone help me?
' Dim naam_project As String = InputBox("naam project", "geef de naam van het project", "")
Dim asmDoc As AssemblyDocument
asmDoc = ThisApplication.ActiveDocument
If asmDoc.DocumentType = kAssemblyDocumentObject Then
Dim PTN_TRADEMARK As String
Dim naam_project As String
naam_project = InputBox("naam project", "geef de naam van het project", "")
Dim oFolderPath As String
oFolderPath = ("C:\$WorkingFolder\PDF_AND_STEP\" & naam_project & "\")
'MessageBox.Show("oFolderPath" & oFolderPath, "Title")
Dim oVaultPath As String
Dim oFileDownloadedSuccessfully As Boolean
Dim oRuleArguments As Inventor.NameValueMap
'Dim foutmeldingen As New ArrayList
'Begin met de hoofdassemblage
Dim asmDef As AssemblyComponentDefinition
asmDef = asmDoc.ComponentDefinition
Dim Occ As ComponentOccurrence
For Each Occ In asmDef.Occurrences
Dim subOcc As ComponentOccurrence
For Each subOcc In Occ.SubOccurrences
Dim subsubOcc As ComponentOccurrence
For Each subsubOcc In subOcc.SubOccurrences
Dim subsubsubOcc As ComponentOccurrence
For Each subsubsubOcc In subsubOcc.SubOccurrences
Next
Next
Next
Next
'MessageBox.Show(foutmeldingen, "Title")
Else
MessageBox.Show("Het actieve document is geen samenstelling (assembly).", "error")
End If