Adjusting transformation type with scripting
Posted: Fri Mar 08, 2024 8:54 am
Hello,
I cannot control the transformation type of an Elastic Timoshenko beam via Python.
So the following command highlighted in red doesn't return PDelta. Could you please guide me on how to get this?
xobj_el.getAttribute('transfType').String = 'PDelta'
Stavros
I cannot control the transformation type of an Elastic Timoshenko beam via Python.
So the following command highlighted in red doesn't return PDelta. Could you please guide me on how to get this?
xobj_el.getAttribute('transfType').String = 'PDelta'
Code: Select all
def beam_element(i_beam, beam_w):
"""
Define the material per beam element.
"""
meta_el = doc_pre.metaDataElementProperty(
'beam_column_elements.ElasticTimoshenkoBeam')
xobj_el = MpcXObject.createInstanceOf(meta_el)
xobj_el.getAttribute('transfType').String = 'PDelta'
xobj_el.getAttribute('-mass').boolean = True
xobj_el.getAttribute('-cMass').boolean = True
xobj_el.getAttribute('massDens').quantityScalar.value = beam_w
# make the element
prop_el = MpcElementProperty()
prop_el.id = doc_pre.elementProperties.getlastkey(0) + 1
prop_el.name = 'Beam_' + str(i_beam)
prop_el.XObject = xobj_el
# add it to the document
doc_pre.addElementProperty(prop_el)
doc_pre.commitChanges()
doc_pre.dirty = True
prop_el.commitXObjectChanges()