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: 

iLogic 'All Visible' rule

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
c.rp.henderson
1600 Views, 5 Replies

iLogic 'All Visible' rule

I find it a pain to have to expand my Representations folder, expand my View folder, right click Master view then select 'All Visible' to turn the visibility of all my parts on again.

I'd like to write an iLogic rule that does exactly this and perhaps have it run by iTrigger or at least an stored as an external rule. I'll only be saving myself 1-2 clicks but every little helps.

Thanks 



Craig Henderson
Inventor Pro 2018.3.3, Build 284 / Vault Pro 2018 / Visual Studio 2012 / Excel 2013
5 REPLIES 5
Message 2 of 6
Owner2229
in reply to: c.rp.henderson

Hi, try this one:

 

trigger = iTrigger()
Dim oDoc As Document
oDoc = ThisDoc.Document
Dim comp As ComponentOccurrencesEnumerator
comp =oDoc.ComponentDefinition.Occurrences.AllLeafOccurrences
Dim Occ As ComponentOccurrence
For Each Occ In comp
    Occ.Visible = True
Next
Consider using "Accept as Solution" / "Kudos" if you find this helpful.
- - - - - - - - - - - - - - -
Regards,
Mike

"Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live." - John F. Woods
Message 3 of 6
damian_dymczyk
in reply to: Owner2229

Hi Guys. 

I found an issue while using All Visible rule. It doesn't work if in there is subassemble in assemble file. Is there any way to fix it ?

Message 4 of 6
pball
in reply to: damian_dymczyk

I found a method that should be exactly the same as right click Show All/Hide All on a view rep.

This will affect the currently active view rep.

ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager.ActiveDesignViewRepresentation.ShowAll

ThisApplication.ActiveDocument.ComponentDefinition.RepresentationsManager.ActiveDesignViewRepresentation.HideAll
Message 5 of 6
c.rp.henderson
in reply to: pball

@pball Perfect! just what I was looking for. Thanks



Craig Henderson
Inventor Pro 2018.3.3, Build 284 / Vault Pro 2018 / Visual Studio 2012 / Excel 2013
Message 6 of 6
hoderd
in reply to: pball

Perfect for getting a Marking Menu command to show all. Had to make it a macro though.

Dave Hoder
SolidWorks Certified Professional

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

Post to forums  

Autodesk Design & Make Report