Model.hm_setsolver#

Model.hm_setsolver(name)#

Sets the HyperMesh solver interface name in order to access entity information available for that solver.

Parameters:

name (hwString) – Solver name keyword. Valid values are abaqus, ansys, autodv, hyperopt, lsdyna, mainfile, moldflow, nastran, optistruct, pamcrash, pamcrash2g, patran, pdm, phlex, simex.

Note

This function does not actually load the solver template. It is intended only to temporarily switch solver type, get attribute information, and reset the solver name back to the original name. This operation is typically required during conversion between solvers.

Returns:

Example#

Suppose LS - DYNA solver template is actually loaded here , get * PSHELL_T * dataname from property with ID 3 for OptiStruct and then reset back to the original solver name#
import hm
import hm.entities as ent

model = hm.Model()

_, result = model.hm_getsolver()

loadedsolver = result.solver

model.hm_setsolver(name="optistruct")
opt_property = ent.Property(model, 3)
opt_thickness = opt_property.PSHELL_T

model.hm_setsolver(name=loadedsolver)