-ChangeLayer not working (as expected) in Rhino 7

I have an alias set to:
_NoEcho _PtOffSelected _-Layer New Ref On Ref Color Ref 0,255,0 Lock Ref EnterEnd _-ChangeLayer Ref SetCurrent=No EnterEnd

I use it when I want to make a new, locked reference layer (if one doesn’t already exist) and set objects to it.

The issue is, when used with the - prefix, the ChangeLayer command does not work, with SetCurrent to both Yes and No.

However, it does work when using the dialog box.

Further testing has shown that it may be something with the layers? Since it worked earlier (that’s how I made the other green ref layer) and if I move the existing ref layer out of the parent layers, the command (and thus, my alias) works.


ChangeLayer Not Working.3dm (30.9 KB)

I’m on Rhino 7.29.23107.3001, 2023-04-17.

Hi @vcruzdesigns
Just FIY it works as expected in V8 :slight_smile:
-Jakob

Hi again @vcruzdesigns
I didn’t notice this first time I looked at it, and didn’t understand why I got it working in V8 and not in V7: You need to put the “SetCurrent=No” before your “Ref”-reference, as selecting which layer the obejct(s) will go on, automatically terminates the command - so you can actually leave out the last EnterEnd:
_PtOffSelected _-Layer New Ref On Ref Color Ref 0,255,0 Lock Ref EnterEnd _-ChangeLayer SetCurrent=No Ref
HTH, jakob

Thanks for the reply Jakob

I tried this as well and no luck. The alias had been working over the last few weeks (but this was when I was only working with 1 un-parented ref layer) and I actually didn’t have the 2nd EnterEnd but I tried adding it to see if it was the issue.

Did it work in your R7?

Hi @vcruzdesigns
Yes, this one - with the “SetCurrent=No”-argument before the “Ref”-argument - works in my V7, it seems.


-Jakob

Yep, so it works if there isn’t a layer with the existing name.

However if a same-named ref layer is nested in another one, it doesn’t:

I hadn’t started using multiple ref layers with this alias until today, so I’m pretty sure the problem isn’t with the macro (as it had been working fine for me previously) but with the -ChangeLayer command and something about specifying layer names in the layer tree.

File from the vid
ChangeLayer Example.3dm (30.9 KB)

Ah yes - I see! Sorry - My guess is, that you will have to get into scripting for that one, but hopefully someone with more brains will chime in! :slight_smile:
-Jakob

No worries, but yeah, I’d much rather not have to get into scripting it lol

Another layer to the mystery (pun not-intended) is that specifying a layer in this specific configuration (as in, one that shares the same name as a child layer) does work with the -DupLayer command for example.

But trying it with -CopyToLayer doesn’t work.

Edit: pun observation