algorithmic modeling for Rhino
Yes.
I see. It can be done by accessing the private field Grasshopper.GUI.GH_DocumentEditor._CanvasToolbar using reflection. Thanks for the hack.
Alan
Hi, you can also directly access the Toolbar object without using reflection:
ToolStrip toolbar = Instances.DocumentEditor.Controls[0].Controls[1] as ToolStrip;
toolbar.Items.Add("Hey I just got inside the toolbar");
FYI, You may wonder how I figured out that the toolbar is located at indices ".Controls[0].Controls[1]" in the code above (when you do not have access to the Grasshopper source code) ?. Well I wrote a simple C# script (attached) that hierarchically lists in all the child controls of the DocumentEditor form. This can be useful if you also so want to hack into other control in the Grasshopper editor as well.
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by