Good morning everyone,
again one little question regarding grasshopper vb scripting.
is it possible to transfer custom Classes to another VB script component input
and access the Methods and functions? do i have to implent it in the rma.opennurbs?
Is it possible to have a custom declaration region for alls vb scripts?
with best regards
Michael Sprinzl
ok i solved the problem....
to build your own custom objects which can be communicating between different VB components:
1. build a classlibary in vb.net like this:
Public Class FEM_element
' Fields
Public Material As Integer
Public Element_nummer As Integer
'Methods
Public Sub New(ByVal i_Material As Integer, ByVal i_Element_nummer As Integer)
Material = i_Material
Element_nummer = i_Element_nummer
End Sub
and save it to the Grasshopperplugin folder!!! as xxx.dll dammm it took me 2 hours to find out.
2. Put 2 VB components on the Grasshopper gui
and attach the xxx.dll with the Referenced Assemblies tool
3. vb component 1:
Dim aa As New FEM_element
aa.Element_nummer = 1122
aa.Material = 12
a = aa
End Sub
vb component 2:
Dim aa As New FEM_element
aa = x
print(aa.Element_nummer)
print (aa.Material)
4. finito bandito .... you now have your own custom type connections ....lol
Tags: