11.0 API Programmer's Guide

CAD Readers

In HyperMesh 11.0, there have been several changes related to CAD readers that affect user scripts.
  • The io/afc_readers directory has been renamed to io/afc_translators. This is to better reflect that both CAD readers and writers are organized in this directory.
  • We have migrated to new third-party libraries.
  • All CAD readers have been renamed to have _reader in the name. Similarly, all CAD writers have been renamed to have _writer in the name.
Because of the above changes, existing command files and Tcl scripts should be updated. The following changes should be made:
  • #catia\catia -> #ct\catia_reader
  • #granite\acis -> #ct\acis_reader
  • #granite\parasolid -> #ct\parasolid_reader
  • #granite\proe -> #ct\proe_reader
  • #granite\step -> #ct\step_reader #dxf\dxf ->
  • #dxf\dxf_reader #iges\iges ->
  • #iges\iges_reader #jt\jt ->
  • #jt\jt_reader #pdgs\pdgs ->
  • #pdgs\pdgs_reader #ug\ug ->
  • #ug\ug_reader #vdafs\vdafs ->
  • #vdafs\vdafs_reader
For example, *feinputwithdata2 #granite\step... should be modified to *feinputwithdata2 #ct\step_reader. If existing Tcl scripts or command files are run that reference the old readers, the following will occur:
  • The new or renamed reader will be used to import the model.
  • The command file will contain the syntax for the new or renamed reader used. Scripts should be modified using this modified output.

This is to allow for compatibility with older scripts. While this compatibility is maintained for the 11.0 release, it may be removed in a future release. Therefore, it is recommended to modify scripts to use the new reader names during this limited transition period.

CAD Metadata

In earlier versions of HyperMesh, metadata generated by the CAD readers always had a prefix associated with it (e.g. .ALTAIR.HW.CAD.<NAME>). In 11.0, by default, there is no prefix added to any metadata generated by the CAD readers (e.g. <NAME>). Instead, a new option @MetadataPrefix has been added to each relevant CAD reader .ini file to control the metadata prefix generated for that reader. Any Tcl scripts that assume a specific prefix for CAD metadata will need to be updated to account for either no prefix, or a custom user prefix.

CAD Color Metadata

In earlier versions of HyperMesh, color metadata generated by the CAD readers was reported as values between 0.0 and 1.0. In 11.0, all color metadata is reported as the actual RGB color value, between 0 and 255. Any Tcl scripts that assume the 0.0-1.0 range for the color metadata will need to be updated to handle 0-255 instead.

Ext API ALTAIR_HOME

In order to run Ext API applications on Windows, it is now necessary to set the ALTAIR_HOME environment variable to the HyperWorks install location. In 10.0, the registry was used to get this value. However, the 11.0 installer does not utilize the registry, so it is necessary to manually specify this location. For paths with spaces, do not use quotes. For example:

ALTAIR_HOME=C:\Program Files\Altair\11.0.0

Ext API Linux Support

Support for Ext API is now available on Linux 32 and Linux 64. The required HyperWorks environment is setup by the ALTAIR_HOME/altair/scripts/hm_extapi link. To run Ext API applications on Linux, the following syntax can be used:

Table Entity

The optitableentr entity has been renamed as the table entity. It is recommended to update all Tcl scripts, FE input readers and solver templates to use the new APIs and new entity name. This includes updating any entity type references from "optitableentry" to "table" in all commands. Please also refer to the complete list of deprecated and removed optitableentry commands below.

Mixed Direct/Indirect Property Warning

By default, a warning message is now posted when an operation results in elements having both a direct and an indirect (mixed) property assignment. The commands affected by this include *copymark, *movemark and *propertyupdate. The warning message is controlled by the *mixedpropertywarning command, which is also exposed via the options panel. Unless explicitly turned off, the message will appear each time one of the above commands results in a mixed property for one or more elements, including through Tcl scripts. This message only appears in interactive mode, not in batch mode. The current value of the option can be found using hm_info mixedpropertywarning.

Postscript Removal

In HyperMesh 11.0, the ability to create postscript files has been eliminated. All postscript commands and corresponding functionality have been removed. Instead, JPEG images of the modeling window can be created using the *jpegfile and *jpegfilenamed commands. On Windows, the hm_windowtofile command can also be used to generate bitmap images of the modeling window.

HWT Namespace Import

In HyperMesh 11.0 and earlier, the HWT namespace (::hwt::) is imported into the global namespace. This means that HWT procedures can be called without using the namespace qualifier, since the procedures also exist in the global namespace (e.g. AddEntry instead of ::hwt::AddEntry). This was originally maintained for backwards compatibility before HWT was separated into its own namespace. For 11.0, in order to provide a transition period, standalone HyperMesh will continue to import HWT into the global namespace. HyperWorks Desktop does not import HWT into the global namespace, however when the HyperMesh client is first loaded, HWT will be loaded into the global namespace to maintain compatibility with HM scripts.

This import of HWT into the global namespace will be discontinued post-11.0. Therefore, it is necessary to review all HyperMesh scripts and ensure that the fully qualified namespace is being used for all HWT procedures.

hmbrowsermanager

In HyperMesh 11.0 the hwbrowsermanager API has been modified and updated. However, this API and its changes are not being published since a new simpler browser API is planned for 12.0. If your scripts use hwbrowsermanager and need to be updated, please contact HyperWorks support to get details on the API and the steps that should be taken to update the scripts.

New Commands

Modified Commands

  • General/Core
    • *createmark/*appendmark/hm_createmark/hm_appendmark – Have been updated with the following selection methods:
      • elements "by ply"
      • elements "by ply id"
      • elements "by ply name"
      • laminates "by ply"
      • laminates "by ply id"
      • laminates "by ply name"
      • materials "by ply"
      • materials "by ply id"
      • materials "by ply name"
      • plies "by element"
      • plies "by laminate"
      • plies "by laminate id"
      • plies "by laminate name"
      • plies "by material"
      • plies "by material id"
      • plies "by material name"
      • plies "by set"
      • plies "by set id"
      • plies "by set name"
      • sets "by ply"
      • sets "by ply id"
      • sets "by ply name"
    • *appendmark/hm_appendmark – Have been updated with the following selection methods:
      • elements "by face" – Now considers displayed 1D plot element as boundaries for finding by face
      • nodes "by face"
    • *clearlist/*createlist/hm_getlist – Have been updated to support plies/laminates.
    • hm_getcrossreferencedentities – Has been updated to support the following:
      • laminates: bags, laminates
      • materials: plies
      • plies: bags, laminates
      • sets: plies
      • tables: all entities
    • hm_getentityarray/hm_getmarkarray – Have been updated to support the following data names:
      • designvars: componentlist, laminatelist, propertylist
      • laminates: interfacepairplyids, laminates, plies
      • plies: sets
    • hm_getlist/hm_highlightlist – Added optional panel_sensitive argument.
    • hm_getreferencedentities – Has been updated to support the following:
      • laminates: laminates, plies
      • plies: materials, sets
      • tables: all entities
    • hm_info – Added optional argument to specify whether template name or ID should be returned. By default, name is assumed for backwards compatibility.
    • hm_info – Added clipboundaryelements, displayimporterrors, geomrefinelevel, mixedpropertywarning, plythicknessfactor, showcompositelayers, showglobalaxes and templateid options. The -appinfo ARCHITECTURE option now returns "win" instead of "" on Windows.
    • *copymark/*movemark/*propertyupdate – Added a warning message when the operation results in mixed property assignments. See the Mixed Direct/Indirect Property Warning section for more details.
  • Geometry
    • *body_trim_with_templine – Added option for closing input line loop.
    • *linefromsurfedgecomp – Updated to only allow surface edge selection.
    • *surfacereversenormals – In 10.0 and earlier, individual surfaces could be adjusted via the Tcl command, which resulted in an inconsistent model which could lead to issues. The normals panel had a check to expand the selection to maintain consistency, which selected all connected surfaces. This command has been updated to automatically select and adjust only the minimum set of surfaces to maintain overall consistency, without affecting other surfaces. The warning message from the panel has been removed, and the behavior of the Tcl command and the panel now match.
  • Graphics
    • hm_getdisplaycolor – Index 11 now returns color1 and index 21 returns color2 for the gradient background.
    • *detailedelements – Added and updated modes to support 1D/2D visualization as 3D.
  • GUI
    • hm_callhelp – Now requires both a book and a topic. The .htm portion of the topic should be removed.
    • hm_framework – Added database_modified as an event type to getregisteredprocs, registerproc and unregisterproc options. Added is_global argument to addtab operation. Added popgui, pushgup and setguigeom options.
    • hwbrowsermanager - Modified options. See separate topic above.
  • Meshing
  • Morphing
  • Post
  • hmgenres
    • Added new -lid option to specify long (16 character) format for entity IDs.

Deprecated Commands

  • Display
    • *setgraphicsengine
  • General
  • Geometry
  • Graphics
    • *setbackgroundcolor – Now sets both color1 and color2 colors to the specified color for compatibility. Instead of using the specific RGB value, it will map to the closest of the standard 64 HM colors. Use *setbackgroundcolors instead.
    • *setdisplaycolor – Indices 11 and 21 are now ignored. Use *setbackgroundcolors instead.
  • HMASCII
  • hminlib
    • HMIN_optitableentr_write() – This command has also been removed. Use HMIN_table_write() instead.
  • Meshing
    • *tetra_cfdmesh/*tetra_cfdmesh_transition/*tetra_remesh/*tetra_remesh_transition/*tetra_volumemesh/*tetra_volumemesh_transition/*tetramesh/*tetramesh_transition – Use *tetmesh instead.
  • Template Commands
    • *optitableentrs() – This command has also been removed. Use *tables() instead.

Removed Commands

  • General/Core
    • *replay
  • Graphics
    • *displaylistdisplaycollector
    • *displaylistdisplaycollectorwithfilter
    • *displaylistoff
    • *setvisualizecontrol
  • hm.cfg file
    • *postcopy()
    • *postfile()
    • *postcopyblackandwhite()
    • *reversevideo()
    • *setbackgroundcolor()
  • hminlib
    • HMIN_optitableentr_write()
  • Imaging
    • hm_postscriptblackandwhitecopy
    • hm_postscriptcopy
    • hm_postscriptfile
    • *postscriptbitmappreview
    • *postscriptblackandwhitecopy
    • *postscriptcolor
    • *postscriptcopy
    • *postscriptfile
    • *postscriptfillmodel
    • *postscriptfilltopage
    • *postscriptgeneratebitmap
    • *postscriptimagesize
    • *postscriptlinewidth
    • *postscriptpagelength
    • *postscriptpagewidth
    • *postscriptplotoptimize
    • *postscriptreset
    • *postscriptreversevideo
    • *setpostscriptmenu
  • Post
    • *calculatecuttingplane
    • *clearcuttingplane
    • *plotcuttingplane
    • *reversecuttingplane
    • *setcuttingplane
    • *translatecuttingplane
  • Template Commands
    • *optitableentrs()