Selection Macros & Automation

Hey all!

I made a complex macro. I’m using the command Orient3Pt, and after one copy of my selected objects, I am trying to

  1. end the command
  2. continue building out the same macro - next command use _SelNone to deselect eveything

Problem is after any way I end the Orient3Pt command, Rhino will not deselect the parent object and will not read any more commands beyond that. Does anyone know a way around this?

…(continuation - it’s a long one)
_Rotate3D w61.85,-4.1,20.1936 w61.85,-4.1,24.1936
w59.9332,-4.1,20.1936 w59.9992,-3.60194,20.1936
_-SelName serial1
_-SelName serial2
_Move w62,-4.1,20.1936 w62,-1.4,20.1936
_SelNone
_-SelName serial1
_-SelName serial2
_Orient3Pt w62,-1.4,20.1936 w62,-1.4,22.1936 w64,-1.4,20.1936
w50,7.36722,19.3624 w50,9.36722,19.3624 w52,7.36722,19.3624 _Enter
_SelChildren <-- (macro stops here)

Thanks!

if you happen to have an extra space after your last command rhino will read that as an enter or right click and could possibly end your macro-

@pascal is ultimately the man for this question

1 Like

I’ll take a look.
@jonathan.silva167 if you want to use Orient3Pt with history, there will be no history or parents or children, unless Copy=Yes.

_#Orient3Pt Copy=Yes w62,-1.4,20.1936 w62,-1.4,22.1936 w64,-1.4,20.1936

-Pascal

Yes I know! My issue is after the first copy I put coordinates in for, the command wants to keep going, and whatever I put in to make the command stop and go to the next command stops the macro completely and prevents the rest of commands from completing.

Hello - this works here - I start with two objects, named serial1 and serial2 plus a third object that is selected when the macro starts:

_Rotate3D w61.85,-4.1,20.1936 w61.85,-4.1,24.1936
w59.9332,-4.1,20.1936 w59.9992,-3.60194,20.1936
_-SelName serial1
_-SelName serial2
_Move w62,-4.1,20.1936 w62,-1.4,20.1936
_SelNone
_-SelName serial1
_-SelName serial2
_#Orient3Pt Copy=Yes w62,-1.4,20.1936 w62,-1.4,22.1936 w64,-1.4,20.1936
w50,7.36722,19.3624 w50,9.36722,19.3624 w52,7.36722,19.3624 _Enter
_SelChildren

-Pascal

Ok I’ll try this and see. What does the # do?

Side note since I hear you’re the resident genius on here lol - is there a command-line equivalent of using CTRL on the keyboard to DE-select items with selection commands? Tried every way I could think of to write a de-select window or cross into my macros but it doesn’t seem to work or I cant find any useful sources on this.

Hello - the # forces history recording for that one command without changing the general history recording setting (% does the opposite, btw) . But it sounds like you need to look at scripting - if your macros are this complex, you’re probably getting to the point where you’re wasting time trying to force things that are just a lot easier (like keeping track of objects, making specific selections for a start) in a script.

-Pascal

Yes absolutely. I am working my way there as we speak. Just trying to get the most out of macros while I learn lol. Thank you for your time, I appreciate it.

Hey!
So I tried it out - it still doesn’t select anything after that last _Enter command. See screenshot for the commands and results.

When I manually type SelChildren or any other command after this macro ends, it works. But nothing typed into the macro after _Enter works. Script stops.

Hello - I can only say it worked OK here, in my test - my feeling is your process is a bit fragile and a step or two more complicated than is convenient in a macro and that you should go after it with a script.

-Pascal

1 Like