Model.convertlegacyentities#

Model.convertlegacyentities(source_entity_type, target_entity_type)#

Converts any of the source legacy entities, in a particular solver interface, to a specified target entity.

This is typically used when an old HyperMesh file has legacy entities defined that need to be migrated to a new entity. For example, if there are old HyperMesh files with ANSYS contacts defined through the old Contact Manager via components, by executing this function they will be migrated from components to groups. It also updates the existing source entity relationships maintained with other entities (that are not converted) with the target entity equivalent.

Supported solver conversions are:

Solver

Source and Target Types

ANSYS

components, groups

Nastran (MSC)

groups, contactgroups

Note that the solver ID is an implicit input, obtained from the current solver template from which this function is executed.

Parameters:
  • source_entity_type (EntityFullType) – The type of entity to convert. If there are no source entities of the requested type, no conversion is performed.

  • target_entity_type (EntityFullType) – The type of entity to convert into.

Example#

Convert ANSYS contact components to groups#
import hm
import hm.entities as ent

model = hm.Model()

model.convertlegacyentities(
    source_entity_type=ent.Component, target_entity_type=ent.Group
)