Hide/Show components... show ALL or show SELECTED?

In followup to the post titled, "Hide/Show components... any way to
show ALL?"
formatting link

There seemed to be a need amongst SolidWorks users for various types
of visibility toggling of components in assemblies. For example,
picking component features (edges, vertices, faces, you name it) from
the graphics area and then hiding them all at once. The macro I wrote
integrates several methods of manipulating visibility all in one
program. It allows combination picks from the graphics area and
feature tree and supports identical functionality in suppression and
visible states.
One of the best features is the ability to select everything you want
to see and hide everything else. The macro is available here,
formatting link
Scroll down to the
section titled "Visibility Toggling".
Reply to
KCS Development
Loading thread data ...
Yes there IS the need for various types of visibility toggling!
The most basic (and seemingly easy to implement) is simply allowing the user to "undo" the previous step of hiding or showing the items selected.
I can't tell you how often I hide things temporarily to then redisplay them after a quick review of the underlying components. With only a few items selected, it's not so bad to pick them again from within the feature manager; however, with a large group, the reselection (sometimes going way down into subassemblies) can be very tedious...
Another basic need is for the ability to reuse the previous selection of items. For example, the first time they're selected it might be just for hiding. Then the user may decide that that same collection should be suppressed, deleted, or reverted to lightweight, etc. Not having to reselect can be a convenient timesaver.
Per O. Hoel __________________________________________________________________
formatting link
Reply to
Per O. Hoel
If I understand you correctly, simply adding a couple buttons to STORE selection and RETRIEVE selection should add the capability you suggest. It would be a timesaver and I plan to implement it. I think I will make the other commands in the Visibility Toggling macro also store the selection so the selection set would not be lost if the user forgot to pick STORE.
Reply to
KCS Development
Well, I've been messing with this on and off for a couple months. (Well maybe only a day or so every week or two, but it's been in the back of my mind.) I just spent all night on it and I finally got it to work. The UI is pretty basic, and some of the error checking is missing, but it will work.
Basically all you do is run the "Record" macro that will store the Hide/Show property of every component part and subassemly (and each of it's component parts and subassemlies, etc...) to the filename that it will prompt you to enter. That's it. The data file it creates is very small (1 KB), so you can have a lot of them. For example, if for some reason you turn some parts on/off, then some others, and then some others and you want to save the Hide/Show for each step, it would be no problem. No limits on the number of data files except your computer memory storage.
Then to "toggle" back, just run the "Reset" macro and type in the appropriate filename of the data file to read in. A note here, any new parts/assemblies inserted after the data file was written will not be affected by the "Reset"...only parts that existed when the data file was created. Also, in the samples I ran thru, it just skipped over any missing/deleted parts/assemblies during the Reset macro, so hopefully no problems there.
The macros could be used to set the suppress/resolved state too, but that would require that there *NOT* be any lightweight components. From what I could tell, the macros would interpet any lightweight parts as suppressed. But some of that code is in there, here and there if you're interested. Personally, I don't want to load in all the "resolved" data unless absolutely necessary.
I don't have anywhere to post this, so shoot me an email and I'll send it to you. FYI, the above email address is a good one.
Reply to
Ken Bolen
OK, this is probably a dumb question, but how are macros better than simply creating a new configuration to toggle part display?
Mike Wilson
Reply to
Mike J. Wilson
I don't think that this is better than configurations. I am planning to use it only for "temporary" hide/showing of parts. Say you've got an assembley with 100 parts on it, and 50 are turned off. Well you decide that you only want to only have 10 of those visible, then do some editing, then go back to the previous 50. The 1st macro writes whether the parts are shown/hidden, then I select the 10 parts I want and run a ShowOnly macro, then you do the editing on those 10 parts (including adding or deleting parts/subassemblies), then run the other macro that resets the show/hide status to get the screen back to the 50 parts (ignorong deleted and new files). I don't know how much more I'll use it instead of just making a temporary configuration. This really came about from the AutoCAD users gripping about how they did this before in AutoCAD and wanted a similiar "macro" style capability. SolidWorks isn't fairing well at our company. We've got AutoCAD that has literally gotten 1,000's of hours of customization in it, specific to our work...and everyone already knows how to use it. I can't stand AutoCAD and am doing whatever I can to get out of the 2D, non-parametric world. Then I saw some posts that sounded like they were looking for the same thing, so here it is.
Later, Ken
Reply to
Ken Bolen
The Visibility Toggling macro for assemblies has been improved. It now offers the ability to store a selection set and retrieve it later. The macro toolbar is also now sizeable. Thanks to Per for the suggestions and helping with the testing. Sorry you ended up being a Beta tester Per.
Anyway, why would you want to use this macro vs. a configuration? They serve different purposes. Configurations are better for static views. During the design process, however, there is often the need to just view a few components to finish an incontext sketch or layout or for mating. That's where the macro comes in handy. It allows dynamic, on the fly, toggling of the visible and suppressed states of components. You can select a few components or even features on a component (edge, vertex, face) and press the Hide Others button to hide everything else. Press Show All does just that. Show Hide hides all visible selected components and shows all hidden ones. Similar commands are available for suppression. Lastly, Store allows you to put a selection set in a buffer for future retrieval. This works well with the Show Hide command as well as for any other command for which you want to do group operations.
Check it out at KentContract.com/swmacros.shtml
Anyone else have suggestions for macros? First release is FREE for the one who suggests a viable macro.
Kent KCS Development
Reply to
KCS Development

PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.