algorithmic modeling for Rhino
I am wondering if there is a way of calling, from a a script component, a function wrote in another different script component.
It would be great!
This is not possible. At present, you'd have to put these functions in a dll that you reference from both components. It would probably be a nice idea to be able to include source code files in scripts.
And yes, it would be very nice!
Is there a way to reference a dll into the C# or VB Grasshopper scriptable component ?
In the menu of VB and C# components you'll find a Referenced Assemblies... item. It allows you to add a dll.
it actually depends. It is not a Grasshopper feature, but there are cases in which it is possible to call functions from other components. The easiest is in Python. You can easily pass function references and callable items to other components and call them from there.
Here is what it would look like:
x() in the middle calls the x function, that returns the text you can see at the end of the definition.
Besides that, this type of operation is also possible in C# and Vb.Net, with a language construct that is called delegate. A delegate encapsulates a reference to a function. However, because delegates are type safe, they are a little more complicated to use. There is an example in the same file in C# and Vb.Net.
To see the Python components, you will need the last version from here.
I hope it helps,
I am trying to make a mathematical function and call it into another python component.
Here is the file, maybe it is possible somehow.
Thank you Giulio, from now on my work will go smoother.