Error: Data conversion failed from Goo to CrossSection

Hi there,
I’m importing Karamba modules via ghpythonlib.component
not sure how to change the guide of karamba based datatypes.

I did a print check with “CroSec = {}, {}”.format(CroSec, type(CroSec)"

and the data type was printed as “CroSec_I”

script below

import rhinoscriptsyntax as rs
import Rhino.Geometry as rg 
import ghpythonlib.components as gh

node_1 = rs.AddPoint(0,0,0)
node_2 = rs.AddPoint(50,0,0)
node_3 = rs.AddPoint(100,0,0)
nodes = [node_1, node_2, node_3]

#create line geometry 
line_seg_1 = rs.AddLine(node_1, node_2) 
line_seg_2 = rs.AddLine(node_2, node_3) 

#cross section 
CroSec = gh.Karamba3D.CrossSectionKaramba3D("beam", "beam_a", None, None, None, None, 30, 100, 100)
line_to_beam = gh.Karamba3D.LinetoBeamKaramba3D(line_elements, None, None, CroSec)
print(line_to_beam )

when I input CroSec to another component or python function I get the following error

Data conversion failed from Goo to CrossSection

the thread here helped me understand the problem but I don’t know how to convert the guid for a karamba “CroSec_I” data type. any thoughts on this ?

thanks in advance !

Hi @keerthana,
try to wrap the CroSec-object before handing it over to Grasshopper. In C# it is
wrappedCroSec = new GH_CrossSection(crossection));
– Clemens