Hello,
I am doing a Customization in Inventor 2012 using VB.net as development language.
My project is heavily dependent on Inventor Assembly Tree. Off late i am facing problems in Finding the Global Parent of Assembly.
For Example
A
B
C
D
E
A1
A2
A3
A4
Lets assume this is the tree structure, lets say i want the parent name of node "A4", is there any option in Inventor 2012 API to find the parent node of Assembly
The below is the part of my code
Public Sub AssmTravel(ByVal InCollection As ComponentOccurrences, ByVal objparentNode As System.Windows.Forms.TreeNode)
Dim ADoc As Document
Dim objoccsEnumerator As IEnumerator = InCollection.GetEnumerator()
Dim objcomOccurrence As Inventor.ComponentOccurrence
While (objoccsEnumerator.MoveNext() = True)
objcomOccurrence = objoccsEnumerator.Current
If objcomOccurrence.DefinitionDocumentType = Inventor.DocumentTypeEnum.kAssemblyDocumentObject Then
Try
ADoc = oApp.Documents.Open(objcomOccurrence.DefinitionReference.ReferencedFileDescriptor.FullFileName, False)
Catch ex As Exception
GoTo VirtualWeldPart
End Try
End IF
End Sub
Solved! Go to Solution.
Solved by amitnkukanur. Go to Solution.
Hi Santosh,
I found the answer by doing some R'n'D.
ADoc.ReferencingDocuments(1).FullDocumentName.
This above line will provide the parent assembly name.
e.node.parent.tostring(); will work in onclick event, but in current scenario things happen before onclick.
rgds
Amit