So I sort of found the solution...
import s4l_v1.model as model
from s4l_v1.model import Vec3
import math
import XCoreModeling
def get_spline_length(spline):
wire = XCoreModeling.GetWires(spline)[0]
return wire.GetLength()
def Thicken_Wire(spline,radius):
wire = XCoreModeling.GetWires(spline)[0]
target_curve = wire.GetGeometry(transform_to_model_space=True)
# compute the length of the spline
height = get_spline_length(spline)
# get the Vec3 of the starting and end points
startVec = target_curve.Eval(0.0)
endVec = target_curve.Eval(height)
# create a cylinder that will be bend to the spline, its height must be the same as the length of the spline
Wire1 = XCoreModeling.CreateSolidCylinder(startVec,Vec3(startVec[0]-height,startVec[1],startVec[2]),radius)
# do the bending
XCoreModeling.BendBodyToCurve(Wire1,startVec,Vec3(startVec[0]-height,startVec[1],startVec[2]),Vec3(0,0,1),target_curve)
# remove the used spline
spline.Delete()
return Wire1
# example
spline1 = model.CreateArc(Vec3(0,0,0), radius, float(10)/180*math.pi,float(350)/180*math.pi)
Wire1 = Thicken_Wire(spline1,1)