NLFE Cable through python script?

Jeeb
Jeeb Altair Community Member

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

  • Orestis_YB
    Orestis_YB
    Altair Employee
    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 mview

    def 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.01

    nlfe.gif

    Hope this helps!

    Best regards,
    Orestes

Answers

  • Orestis_YB
    Orestis_YB
    Altair Employee
    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 mview

    def 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.01

    nlfe.gif

    Hope this helps!

    Best regards,
    Orestes

  • Jeeb
    Jeeb Altair Community Member

    Thanks works like a charm :)

Welcome!

It looks like you're new here. Sign in or register to get started.

Welcome!

It looks like you're new here. Sign in or register to get started.