More performant method of oView.SetVisibility?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm reviewing an old but commonly used macro to see if i can make it more performant. With part priority active it allows a user select a component in a drawing view, then it turns off the visibility of every other component, leaving just the one they clicked on.
For small assemblies it's fine but as part count increases so does the time it takes to process. It's significantly more than doing control/shift select's in the browser, right click>visibility=false.
Rather than setting visibility on each iteration of a loop, i tried creating an array of oRefAssy.ComponentDefinition.Occurrences(i) but it always result in 'nothing'. I'm not sure why and i didn't get as far as trying to pass this in just to see if it would work.
ie Dim oOccs() As ComponentOccurrence
In any case, is there a better way to turn off the visibility of multiple child components in a drawing view? Quantities can be >100s, screenupdating is always false.
Did you find this reply helpful ? If so please use the Accept as Solution or Kudos button below.
---------------------------------------------------------------------------------------------------------------------------
Inventor 2010 Certified Professional
Currently using 2023 Pro