OK, thank you to both @pascal and @clement, you put me on the right track, but it still took me a while to get all the bits in the right order.
To be more precise, including ALL the details that needs to be in order :
- Write the script.
- And as @pascal says, make sure to leave out the “
Call SubName()” (or the “
Call Main()” row, which would be in the default code when creating a new script file)
Fig 1. §1 & 2 above:
3, Specify the script file to be loaded on Rhino startup (due to the rule §2 above, the script will not automatically run when loaded) :
Fig 2. Load script :
4, Now add an Alias for calling the script from the command line ("
FL") in this case :
Fig 3. Add Alias :
4, Add this post to the Rhino Help File.
For anyone interested in the script (Find and Set a specified Layer as the CurrentLayer) here it is - FLayer.rvb :
FLayer.rvb (1.0 KB)
Hint: Full path can be specified, like so:
To simplify typing long paths the script also translates any comma (",") into the std path delimiter “::”, meaning that also the following path would be found:
If only the end target layer name is specified (i.e. “
ASO” above) the first occurrence in the layer tree is set to CurrentLayer. If the layer name or path is not found, a message indicates so in the command line.
See also Layer search