Custom command: Select Objects By Type

Next
 From:  tyglik
1106.1 
Select objects by type

This custom command helps you select all visible objects of a given type. The command doesn't deselect the selected objects, it means the command adds to the current selection only.

You can select the object which will define the object type to select before the command starts. In this case, when one and only one object is selected, command will run without any user intervention and in accordance with the state of a subtype checkbox the objects of the given type will become selected. The object you can pre-select are:
-point
-curve (with subtype button checked either open or closed curves will be selected )
-surface (with subtype button checked either open or closed surfaces will be selected )
-edge
-face

Without pre-selected object the command prompt will stay accessible in order to enable user to check/uncheck the subtype button and pick the object. If you pick the curve or point, command will do its work and finishes. If you pick a surface, the "Done" button appears - then you will be able to finish command by pushing it (or clicking the right mouse button) immediately to select all closed or open surfaces _or_ select edge or face in drill-in mode first to select all edges or faces.

If there is more than one object selected before command starts, it will work as described above except the pre-selected objects become deselected temporarily.

It sounds somewhat complicated, but I believe it's quite intuitive.

An advantage of this command is that many macro scripts will become unnecessary hereafter :)

Unzip the file SelectByType.zip into the \commands subfolder under your MoI main program files folder. Then go to Options / Shortcut keys, and add some new entries, like:

S	SelectByType


You can also download the 3dm file objectsample.zip to see how command works with all the MoI object type...

Petr

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
1106.2 In reply to 1106.1 
Hi Petr, it works great!

I think that's a nice idea to have it work by following the "example" of the initial single selection, kind of like the priming mechanism for edge or face sub-object selection with window select or select all.

I'd like to add something like this to the regular selection palette for V2, in addition to selection filters. I was previously thinking of having some kind of a menu that popped up a bunch of things like "Select all curves", "select all surfaces", "select all points", etc... But your way shows a good way to potentially combine all those into one thing.

Hmmm, one potential problem though - say you have just the box selected, and now you want to select all curves in addition to that. It won't work for that since it will take the box as the example right away... Probably not a problem for your use but it may interfere with using it as a totally general replacement for separate menu items...

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Paul (AIRGLASS)
1106.3 
Hi, Petr,
Tried out your new script - works great! -- good job :)

Paul
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael T. (MICTU_UTCIM)
1106.4 
Very nice Petr! Thanks!
Michael Tuttle a.k.a. mictu http://www.coroflot.com/fish317537
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  tyglik
1106.5 In reply to 1106.2 
Hi Michael,

>> say you have just the box selected, and now you want to select
>>all curves in addition to that. It won't work for that since it will take
>>the box as the example right away...

Hmmm... If I linked that custom command to the icon/button, I guess it could be solved. The first click on icon/button would start command as if there was no preselection allowed, it means the command prompt would pop-up and wait for picking an object, but the second click on icon/button would lead to resuming command using pre-selected object - similar to how command Hide works :)

Petr
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
1106.6 In reply to 1106.5 
Hi Petr,

I guess that could solve it, but at that point it seems rather complex compared to a menu with several choices on it...

It's true that it would be similar to Hide, but Hide is kind of a compromise from several different pressures on it, I'm not so sure if it is good to use Hide as a general model to follow.

Since Hide is used frequently it really needed to operate as a top-level button, and I really didn't want to have 3 buttons like "Hide", "Show", and "Show selected", all there at a prominent level, that would just take up too much space.

Selecting objects by type, while certainly useful, just isn't as frequently accessed. So it is not as bad to have stuff for it kind of nested down one level in a sub menu or something like that.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All