Model.hm_info#
- Model.hm_info(option)#
Returns general information about HyperMesh session.
- Parameters:
option (hwString) – The name of the information to retrieve. Valid values are currentinclude, currentfile, database_empty, database_modified, geomstyle, istemplateloaded, reviewmode, templatecodename, templatefilename, templateid, templatetype, tempnam, writeviewcommands.
- Returns:
hwReturnStatus- Status objectHmQueryResult- Result object containing the output values:Keys valid for
option="currentinclude"info_value (str) - The current include file shortname.
Keys valid for
option="currentfile"info_value (str) - The full path and file name of the current HyperMesh database.
Keys valid for
option="database_empty"info_value (Bool) - Indicates whether the database is empty.
Keys valid for
option="database_modified"info_value (Bool) - Indicates whether the database has been modified.
Keys valid for
option="geomstyle"info_value (int) - The current geometry color mode set by Model.settopologydisplaytype.
Keys valid for
option="istemplateloaded"info_value (Bool) - Indicates whether a template is loaded.
Keys valid for
option="reviewmode"info_value (int) - The current review mode set by Model.setreviewmode.
Keys valid for
option="templatecodename"info_value (int) - The current template code identifier. Solver identifiers 0-63 are reserved for HyperMesh officially supported templates. Solver identifiers 64-127 inidicate a user-defined template.
Keys valid for
option="templatefilename"info_value (str) - Full path and file name of the current tempate file.
Keys valid for
option="templateid"info_value (int) - The current template ID.
Keys valid for
option="templatetype"info_value (str) - Current template type. This is one of the predefined template types, currently one of the following: nastran, abaqus, autodv, hyperopt, pamcrash, patran, ansys, lsdyna, simex, phlex, pdm, mainfile, or none. Some template type names are not reported.
Keys valid for
option="tempnam"info_value (str) - Full path and file name of a temporary file. The value returned from each call is unique.
Keys valid for
option="writeviewcommands"info_value (Bool) - Indicates whether view commands are written.
Example#
Get the path of the current HyperMesh database#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_info("currentfile") print(result.info_value)
Check if the current database has been modified#import hm import hm.entities as ent model = hm.Model() _, result = model.hm_info("database_modified") if result.info_value: print("The database has been modified.") else: print("The database has not been modified.")