Getting started
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
db.models['class40.1'].material_data.materials['Corecell_A450'].rho = 90.0
# get active model
model = db.active_model
# get total thickness of all elements
thicknesses = list(model.mesh_query(name='thickness',position='centroid',selection='all'))
# get element labels
labels = model.mesh_query(name='labels',position='centroid',selection='all')
# get maximum thickness
max_thickness = max(thicknesses)
index_of_max = thicknesses.index(max_thickness)
# get element label with max thickness
element_label_with_max_thickness = labels[index_of_max]
# get active model
model = db.active_model
# create new selection of all elements attached to a specific ply
modeling_ply = model.modeling_ply_groups['Core'].plies['mp_4']
model.select_elements(selection='sel0',op='new',attached_to=[modeling_ply])
# get total thickness of the first entity of selection sel0
thicknesses = list(model.mesh_query(name='thickness',position='centroid',selection='sel0', entities=[modeling_ply])[0])
# get element labels
labels = model.mesh_query(name='labels',position='centroid',selection='sel0')
# get maximum thickness
max_thickness = max(thicknesses)
index_of_max = thicknesses.index(max_thickness)
# get element label with max thickness
element_label_with_max_thickness = labels[index_of_max]
# get active model
model = db.active_model
# get first solution
solution = model.solutions.values()[0]
# get the failure criterion definition
fc_definition = model.definitions['FailureCriteria.MaxStrain_Core']
# get element labels
labels = model.mesh_query(name='labels',position='centroid',selection='all')
# get inverse reserve factors of all elements
irfs = list(solution.query(definition=fc_definition,position='centroid',selection='all',component='irf'))
# get failure modes of all elements
failure_modes = solution.query(definition=fc_definition,position='centroid',selection='all',component='fm')
# get the maximum IRF value
max_irf = max(irfs)
# get the index of maximum IRF
index_of_max = irfs.index(max_irf)
# get failure mode corresponding to maximum IRF
critical_failure_mode = failure_modes[index_of_max]
# get element label where the maximum IRF occurs
element_label_of_max = labels[index_of_max]
Was this page helpful?