NLFE Cable through python script?

Hey,
I am currently working with NLFE Cable Bodies in MotionView and am quite pleased with them.
I now want to generate them through a python script, since my final model will be quite large with lots elements that will have to be scripted. However I can't seem find a corresponding comand or way to do it.
Maybe I'm missing something or perhaps it's not possible.
Any help will be greatly appreciated.
Kind regards
J
(2022.3)
Best Answer
-
Hello @Jeeb,
to create a NLFE Body using python command you need to use mview.LDBody(). Here is a script where I am creating 50 Points to define a NLFE rod of diameter 1mm
from hw import mviewdef createPoint(idx,dx,sys,offset):
return mview.Point(parent = sys ,name='p_' + str(idx), label='Point ' + str(idx), x = offset + idx * dx)N_beam = 50
d_beam = 5#points for nlfe
p_nlfe = [createPoint(num,d_beam,'MODEL',0) for num in range(N_beam)]#NLFE Body
nlfe=mview.LDBody(parent = 'MODEL', points = p_nlfe, name = "nlfe1", label = "NLFE Beam 1")
nlfe.cross_section_type = 'Rod'
nlfe.dim1_start = 1
nlfe.rayleigh_damping = 0.01Hope this helps!
Best regards,
Orestes1
Answers
-
Hello @Jeeb,
to create a NLFE Body using python command you need to use mview.LDBody(). Here is a script where I am creating 50 Points to define a NLFE rod of diameter 1mm
from hw import mviewdef createPoint(idx,dx,sys,offset):
return mview.Point(parent = sys ,name='p_' + str(idx), label='Point ' + str(idx), x = offset + idx * dx)N_beam = 50
d_beam = 5#points for nlfe
p_nlfe = [createPoint(num,d_beam,'MODEL',0) for num in range(N_beam)]#NLFE Body
nlfe=mview.LDBody(parent = 'MODEL', points = p_nlfe, name = "nlfe1", label = "NLFE Beam 1")
nlfe.cross_section_type = 'Rod'
nlfe.dim1_start = 1
nlfe.rayleigh_damping = 0.01Hope this helps!
Best regards,
Orestes1 -
Thanks works like a charm :)
0