When working on large DWG’s from architects I often want to select objects that are on the same layer as a given curve I pick from the drawing so I think a SelLayerSelected would be great to include in Rhino.
I have my own scripts that I use for this though, so if anybody want’s it then here it is:
### --- Select objects on same layer as selected
### --- by Holo 2019
import rhinoscriptsyntax as rs
obj_id=rs.GetObject("Select them", preselect=True)
visibleObjects=rs.VisibleObjects(view=None,select=False, include_lights=False, include_grips=False)
for obj in visibleObjects:
Hi Jorgen - I see the RMB of SelLayer is SelLayerNumber, which, I confess, I did not even know or recall was a thing. I’d replace that RMB with-SelLayer _Pick. I don’t think I’ll do it in the default though - it might be pulling the rug out from someone’s workflow.
This is something I use all the time, the only suggestion for the -SelLayer _Pick command would be to add additional option “FromSelected”, maybe at the same level as _Pick? So it works with preselection.
With that, it would be just a click away to select all objects from selected objects layers.
I have a script that does it currently but it is so handy that you should consider adding it to Rhino as a regular command.
Dim arrPre : arrPre = Rhino.SelectedObjects()
Call Rhino.Command("-_SelLayer _Pick")
If Not isnull(arrPre) Then
Dim Dict : Set Dict = CreateObject("Scripting.Dictionary")
Dim arrO : arrO = Rhino.SelectedObjects()
For i=0 To Ubound(arrO)
If Not Dict.Exists(Rhino.ObjectLayer(arrO(i))) Then Call Dict.Add(Rhino.ObjectLayer(arrO(i)), True)
arrL = Dict.Keys
For i=0 To Ubound(arrL)