Model.ME_ModuleExport#

Model.ME_ModuleExport(part_entity, recursive, filename, export_template, string_array)#

Exports the contents of a module to an export file based on an output template.

Parameters:
  • part_entity (Entity) – The object describing the part entity to export.

  • recursive (int) –

    Specifies option for whether the module hierarchy should be traversed recursively to identify all of the entities to be exported.

    If set to 0, only the entities from the specified module will be exported.

    If set to 1 (or any non-zero), the entities from the specified module and all of its child modules will be exported.

  • filename (hwString) – The full path and filename of the output file. Paths with spaces must be enclosed in quotes.

  • export_template (hwString) – The full path and filename of the export template to be used. Paths with spaces must be enclosed in quotes.

  • string_array (hwStringList) – The string array that contains the additional output parameters.

Example#

Export the output use the OptiStruct template, to a file named “C:/model.fem” for all entities in part with ID 10#
import hm
import hm.entities as ent

model = hm.Model()

model.ME_ModuleExport(
    part_entity=ent.Part(model, 10),
    recursive=0,
    filename="C:/model.fem",
    export_template="hm_info -appinfo SPECIFIEDPATH TEMPLATES_DIR]/feoutput/optistruct/optistruc",
    string_array="",
)