To output all entities using the OptiStruct template, to a file named C:/model.fem:

set template [hm_info -appinfo SPECIFIEDPATH TEMPLATES_DIR]
*feoutputwithdata "$template/optistruct/" "C:/model.fem" 0 0 1 1 0

To output all entities using the OptiStruct template, to a file named C:/model.fem, but do not export any connector data:

set template [hm_info -appinfo SPECIFIEDPATH TEMPLATES_DIR]
*createstringarray 1 "CONNECTORS_SKIP"
*feoutputwithdata "$template/optistruct/" "C:/model.fem" 0 0 1 1 1