Macro options with pre-selection

Hi All :slight_smile:
So a question on macros - something I’ve always wondered about, but has just worked around so far:

Is there a way to set command options in macros that would work with pre-selections? An example: I have “ExtractSrf Copy=Yes” and “ExtractSrf Copy=No” as separate aliases, which works fine - but not with pre-selection. I can insert SelNone and SelPrev to get it to work with pre-selection, but then it doesn’t work without. I’m sure it could be scripted, but I’m not able to ('cause I’m dumb) and also this is more of a general question on the abilities of macros.
TIA, Jakob

This should work with preselected (subobject selected) faces:

_ExtractSrf _Copy=_Yes _SelNone _SelLast

The _SelNone _SelLast is to deselect the original sub-object faces and select the newly extracted faces.

Ah, great! I had the SelNone BEFORE ExtractSrf, not “inside” the command, so it was more of a grammar error than a misspelling! Thanks a lot Mitch!

Argh, dang. That doesn’t work either. If there’s no pre-selection - and the file is not brand new - whatever was used in the previous command is selected on SelPrev, potentially leading to some very wrong results :rofl:
I’ll just stick with getting used to not using pre-selection!
Thanks, Jakob

Hmm, works here. But don’t use SelPrev, use SelLast. I tested the macro I posted above with both pre- and post-selection, seems to work correctly. If not maybe post an example that doesn’t work?

Hi @Helvetosaur
Quite simple: Empty/new file, create box, call _ExtractSrf _Copy=_Yes _SelNone _SelLast via alias and the whole box is selected - at least that’s what I’m seeing :grimacing:

Hi @Helvetosaur
Sorry, I just re-read your answer. What I’m looking for, is for the same alias to work both with AND without pre-selection, and that’s what is not working. As long as there’s a pre-selection, no problem. Hope that clarifies…

Oh, OK, I see. It just needs a _Pause

_ExtractSrf _Copy=_Yes _Pause _SelNone _SelLast

Perfect! Thank so much, Mitch! Have a great weekend :slight_smile: