algorithmic modeling for Rhino
I was wondering if it is possible to tweak some settings in ghPython so it is possible to define imports automatically. In this way, each time a new ghPython component gets created, multiple imports previously defined are automatically written.
For example, I noticed that the WIP version of ghPython always contains those lines:
"""Provides a scripting component.
x: The x script variable
y: The y script variable
a: The a output variable"""
__author__ = "Paul.Poinet"
import rhinoscriptsyntax as rs
I think it would be great if we were able to customize this part.
This question is probably more for Giulio but if anyone out there knows the answer I would be very interested.
This is already the case in Rhino 6 WIP, but if you're working in Rhino 5 the fastest way I can think of is to create a "template" user object. See attached.
Please note that it takes longer to instantiate this component because it's loading the libraries simultaneously.
Indeed creating a user object is doing the trick. I was imagining something more generic and native to ghpython itself but I will use this method, thanks!
I checked out Rhino 6 WIP but I will stick to v5 due to some unexplained crashes...