Argument type for paramters in Karamba.Elements.LineToBeam.solve()

Hello,

I am using the Karamba.Elements.LineToBeam.solve() method in my ghpython component.

the first parameter is described as IEnumerable[point3] in the docs. In python used a list of point3 as the input. I got the following error

Runtime error (ArgumentTypeException): expected IEnumerable[Point3], got list

Traceback:
  line 131, in script

Not sure what input time should be entered for the first parameter in python. If someone could shine some light on this, I would be very grateful!

on a different note, I would like to commit some docs examples in python to the Karamba API page, where can I make a PR ? I could not find any public repo.

thank you!

Hello @keerthana,
regarding the IEnumerable: maybe this link helps: Issue with IEnumerable(GeometryBase).
The Karamba3D API documentation is auto generated (using Sandcastle) and not hosted in a repository. There is however a public repository with Karamba3D scripts: GitHub - karamba3d/K3D_Scripting: The essentials to scripting with Finite Element Toolkit Karamba3D. It would be great if you could add python scripting examples there. If you tell me where I can then add links in the API documentation.
– Clemens

Hi @Clemens,

many thanks for replying the post you share was helpful indeed. I maned to fix the first argument but the type of the second argument still has an error. seems that a nested list type of input is expected but I’m not sure how to make a nested IEnumerable[IEnumerable[Line3]].

the error is attached below

Runtime error (ArgumentTypeException): expected IEnumerable[IEnumerable[Line3]], got List[Line3]

Traceback:
  line 42, in script

Below I have attached the test code

clr.AddReferenceToFileAndPath('C:\\Users\\ukeer\\AppData\\Roaming\\McNeel\\Rhinoceros\\packages\\7.0\\Karamba3D\\2.2.0.12\\Karamba.gha')
clr.AddReferenceToFileAndPath('C:\\Users\\ukeer\\AppData\\Roaming\\McNeel\\Rhinoceros\\packages\\7.0\\Karamba3D\\2.2.0.12\\KarambaCommon.dll')
from Karamba.Geometry import Point3
from Karamba.Geometry import Line3
from Karamba.Elements import LineToBeam
from System.Collections.Generic import List
from Karamba.Materials import FemMaterial_Isotrop
from Karamba.Materials import FemMaterial
from Karamba.CrossSections import CroSec_Trapezoid
import ghpythonlib.components as gh
import rhinoscriptsyntax as rs
import Rhino.Geometry as rg

#nodes
pt_1 = Point3(0,0,0)
pt_2 = Point3(50,0,0)
pt_3 = Point3(100,0,0)
node_list = [Point3(0,0,0), Point3(50,0,0), Point3(100,0,0)]
nodes = List[Point3](node_list)

#line

line_list = [Line3(Point3(0,0,0), Point3(50,0,0)), Line3(Point3(50,0,0), Point3(100,0,0))]
lines = List[Line3](line_list)

#material
clt_material = FemMaterial_Isotrop("beam", "beam_a", 1155, 69,57,78.5, 23.5, -23.5, FemMaterial.FlowHypothesis.mises, 1e-4, None)
clt_crosec = CroSec_Trapezoid("beam", "beam_a",None,None,clt_material,30, 100, 100)

#define beam element
a = LineToBeam.solve(nodes, lines, False, True, None, None, None, None, clt_crosec,True, None, None, None)

any thoughts?

Finally many thanks for the instructions on how to share docs.

-Keerthana