Is there any way to modify existing Rhino commands to add a graphical prompt, a dialog to them (like in SelLayer command) that would prompt you to select named items in Rhino document. My use case is to modify the RemapCplane command as most of my Cplanes have very long names (or contain spaces), so to make it more convenient to select them.
Unless there is any other workaround already (e.g. adding autocompletion for such items in the command prompt)?
it seems like typing a full name of a Cplane works, but these can get lengthy on larger projects (e.g. 83475-Section-B-2). It would be helpful if a graphical dialog (or some autocompletion) could appear then.
Oh sorry, in ChangeLayer command for example the dialog is so that you can type the first few letters of the name to select it or navigate to it with arrow keys - effectively hands can stay on the keyboard.
I’ve checked that there is no ChangeCplane command in rhinoscriptsyntax, but perhaps there may be some more general way of creating this type of dialogs? Maybe something in Eto?
I see, so autocomplete is the goal in any case - got it. That makes sense. @Daniel_Krajnik , chatting with the developer, it seems most likely, given how Rhino works internally, that this would take the form of a “List” command line option when Rhino is asking for the plane name which would then pop up a searchable list box that could be made to follow ytour typing. A full on autocomplete at the command line for the names is a much bigger deal and is not likely to happen in the V8 time frame though having something like that that could be used sort of ‘generically’ here and there in Rhino wiould be a nice thing.
you can query the named cplanes by rhinoscript or phyton
import rhinoscriptsyntax as rs
cplanes = rs.NamedCPlanes()
with cplanes you can build some simple GUI to select the target cplane.
build a commandString with the target cplane and the remapcplane command
don t forget to double quote the cplane name (because of spaces)
then script the _remapcplane command
Thanks, I’d love to try that, but I’m not quite sure how to
is there an example that you could point me to, so I could see how to feed the output of the rs.NamedCPlanes() call into a rs.GetLayers()-like list to select a target CPlane?
import rhinoscriptsyntax as rs
import scriptcontext as sc
def test():
planes = sc.doc.NamedConstructionPlanes
if planes.Count > 0:
planeNames = [plane.Name for plane in planes]
x = rs.ListBox(planeNames)
if x is not None:
rs.Command("RemapCPlane Pause CPlane " + chr(34) + x + chr(34) + " Enter")
test()