assign a command alias to right-click context menu via Rhino.Command

I am making a RhinoScrip tool to assign a command alias to the
context menu for right-clicking of the mouse. But the Rhino.command
method does not seem to work.
For instance, let's suppose I have an alias defined as MY_COMMAND, and
I like to install it in the context menu showing up as MY_MENU.


Rhino.command "!-_options Context Object Add MY_MENU MY_COMMAND Save _Enter _Enter "


The above runs without any error but does not add anything to the context menu at all.

And if I try this by typing -Options in Rhino command line and follow the
prompt there by typing (instead of Options dialog GUI), it goes through
the same option sequence, but nothing gets added to right-click menu, either.
Rhino behaves as if the Save function for Options command is not implemented.

But if I try the same sequence manually in the GUI dialog by starting it
from Tools>Options menu and modify Context Menu there, it works, and the new item is added to the context menu.

Does anyone have an idea what is wrong?

Views: 563

Replies to This Discussion

Hi Takehiko,

In the future, you might want to post these types of questions on our Scripting discussion forum:

First, your macro is incorrect. It should look more like this:

Rhino.Command "_-Options _ContextMenu _Object _Add Volume Volume _Save _Enter _Enter"

Second, there appears to be a bug in Rhino that is preventing this macro from working. I've reported this to the development staff.


-- Dale

Thanks, Dale. (This was my first time using this site.)

If there is any development that resolves this issue, please post it for me.
I tried it on both Rhino 4 and Rhino 5, and they seem to have the same problem.





© 2020   Created by McNeel Admin.   Powered by

Badges  |  Report an Issue  |  Terms of Service