Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Filtering a partslist by ViewRep

3 REPLIES 3
Reply
Message 1 of 4
NachitoMax
397 Views, 3 Replies

Filtering a partslist by ViewRep

Hey

 

so there isnt a way to filter a partslist by a viewrep with code? Is there any other way at all to do this?

 

Why are so many features with Inventor not available in the API? it makes the job of the coder sooo much harder when a workflow is required but the API only allows 80% of feature access....

 

Thanks

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


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.


3 REPLIES 3
Message 2 of 4
WCrihfield
in reply to: NachitoMax

You mean any other way to do it by code, right?  I assume you know how to do it manually.

There is a different process to achieve a similar goal, without using the Parts List filter.

You can switch the BOM Structure status of those parts which you have turned off to Reference, instead of Normal.

These two settings (Visible & Reference) work well together to not only not show them in the drawing views, but also not show them in the parts list.  The Reference settings works with the Structured BOM View, which is the default BOM View of the parts list, when you create them.  So, when you create the parts list by code, even though you can't specify the BOM View setting, it is set to Structured by default, which works the way we need it to.

The quickest & easiest way to do this is likely to first create an ObjectCollection of those components.  Then you can use this within the oDesignViewRep.SetVisibilityOfOccurrences(oOccsCollection,False).  Then use a For Each loop through the collection, defining each as a ComponentOccurrence, then setting their BOMStructure to BOMStructureEnum.kReferenceBOMStructure.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 3 of 4
NachitoMax
in reply to: WCrihfield

Hi

 

Thanks for the reply. Im not sure that your solution would work in my instance. In the same document set, i have a full BOM list that is set to All Levels so that i can get a full BOM tiered partslist. This affects my filtered list. My filtered list only needs to show the visible items set up in a View Rep. By setting some components to reference, it will remove them from both partslists.

 

I dont know why Inventor doesnt allow different partslist types or access to filtered ViewRep lists through the API...

 

I think i have another solution which is mainly a hash together job. I have added a custom property to all components that are visible in the required ViewRep.

 

  1. create full all levels list
  2. temporarily add a column at the end of the list and set the value to the ViewRep property
  3. loop through all rows and turn the row off if the ViewRep property is not present

this gives me the same result. Only issue i have is future proofing. If any components are added after the code process, they will appear in the partslist until the code is run again. This can be fixed with a menu button to refresh lists

 

Thanks

Nacho

Automation & Design Engineer

Inventor Programmer (C#, VB.Net / iLogic)


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.


Message 4 of 4
WCrihfield
in reply to: NachitoMax

I thought of something similar to that too.  There are several ways to 'mark' a ComponentOccurrence or Document, depending on how you want to check for the 'mark' later.  Perhaps an Attribute may work better though, so you don't have to resize your Parts List with the extra temporary column.  It might require a little more code though.

And as for updating it.  Perhaps using the iLogic Event Trigger "After Open Document" would ensure that when you open it at some later date, that the data will be correct, without having to remember to click a special button.  If your code isn't all in iLogic, you can still use a simple internal rule that only runs the other external rules/macros.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report