mcneel / ghpython

A Grasshopper component for Rhino.Python
http://www.food4rhino.com/project/ghpython
119 stars 34 forks source link

Access to Script component which maintains the script #44

Open sbaer opened 12 years ago

sbaer commented 12 years ago

Add built-in variable for ghpython scripts to access Grasshopper.Kernel.IGH_ActiveObject. This allows for access to the same bits and pieces that VB/# scripts have access to in grasshopper. See the DottetLine.gh VB script component for a sample http://www.grasshopper3d.com/forum/topics/display-pipeline?commentId=2985220%3AComment%3A639887

piac commented 10 years ago

ghenv.Component provides access to that instance.

Similarly to the way other scripting components address this, I also think that the ghPython component should provide some special names that are called to calculate the bounding box or show mesh and curves preview. This would make it a lot easier to override the drawing behavior.

We could even possibly encapsulate the current code into a class.