Checking if part is a sub component of subassembly

Checking if part is a sub component of subassembly

NachoShaw
Advisor Advisor
780 Views
3 Replies
Message 1 of 4

Checking if part is a sub component of subassembly

NachoShaw
Advisor
Advisor

Hey

 

Is there a way to check if a part is at top level or in a sub assembly? I need to process any part in the top level assembly that is not in a sub assembly, and only process those directly at top level, ignoring any part in a sub assembly. Im currently using 

 

Dim oRefDocs As DocumentsEnumerator = CurrDoc.AllReferencedDocuments
   For Each oRefDoc As Inventor.Document In oRefDocs
   'do my things here
   Next

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Accepted solutions (1)
781 Views
3 Replies
Replies (3)
Message 2 of 4

NachoShaw
Advisor
Advisor
Accepted solution

I managed to resolve this in a crude way by matching referencing documents

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes
Message 3 of 4

leonque
Enthusiast
Enthusiast

Built in a top level Assembly containing the whole Project.

From there, export structurated BOM list to Excel format. make sure you include the category "File name"

Once in excel, at the Elemet colum you get a hyerarchy path delimted by "." for every single part or assembly.

Once splitted in different columns, This path allows you to identify direct parents at every level.

Double filter top level assemblies, By iam type an  direct parents=Void. then you get top leve assemblies

 

I hope that this give you a clue.

 

In ms POWERBI you have specific functions to manage Depth of paths automatically. In Excel is a little bit mor work, but you can get it at the end.   

 

 

0 Likes
Message 4 of 4

NachoShaw
Advisor
Advisor

Hi

Thanks for the reply. i would prefer not to have any external excel work. The current process that works for me is the following:

For Each oRefDoc As Inventor.Document In oRefDocs
   Dim ParentName As String = _invApp.ActiveDocument.FullDocumentName
   Dim CheckParentName As String = oRefDoc.ReferencingDocuments(1).FullDocumentName
   If ParentName = CheckParentName Then
   'its a top level component
   End If
Next

 

Thanks

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


0 Likes