Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

hypermesh tcl script define elements type

Status
Not open for further replies.

enigma111

Computer
Apr 3, 2020
1
0
0
CN
Hi, I'm new to hypermesh and I want to use tcl script to generate mesh and export it to ansys. So I copy and modify some commands from the commands file and the script is here.



#pre process

*loaddefaultattributevaluesfromxml D:/Altair/hm/scripts/br/views/autocontact/ansys/DefaultAttribVals/Ansys.xml
*templatefileset [file join [hm_info -appinfo ALTAIR_HOME] templates feoutput ansys ansys.tpl]



#import iges file
*start_batch_import 3
*setgeomrefinelevel 1
*geomimport "auto_detect" "C:/Users/zpc/Desktop/test.iges" "CleanupTol=-0.01" "CreationType=Parts" "DoNotMergeEdges=off" "ImportBlanked=on" "SplitComponents=Part" "TargetUnits=CAD units"
*end_batch_import



#create constriants on geometry

*startnotehistorystate {Created Constraints}
*createmark surfaces 1 5-10 51-56
*loadcreateonentity_curve surfaces 1 3 1 0 0 0 0 0 0 0 0 0 0 0
*endnotehistorystate {Created Constraints}



#create element type

*startnotehistorystate {Sensor "SOLID285" created}
*createsensor "SOLID285"
*createmark sensors 2 "SOLID285"
*dictionaryload sensors 2 "D:/Altair/templates/feoutput/ansys/ansys.tpl" "SOLID285"
*startnotehistorystate {Attached attributes to sensor "SOLID285"}
*attributeupdateint sensors 1 141 8 0 0 285
*endnotehistorystate {Attached attributes to sensor "SOLID285"}
*endnotehistorystate {Sensor "SOLID285" created}



#mesh
*createstringarray 3 "pars: post_cln tet_clps='0.100000,0.300000,0.500000,1.000000,0.380000,0.100000'"   "tet: 99 1.3 -1 0 0.8 0" "2d: 1 0 1 0.5 0.025 30 1"
*createmark solids 1 1
*tetmesh solids 1 0 elements 0 -1 1 3



#assign generated elements with created element type

*attributeupdateentity components 2 3081 8 2 0 sensors 1
*elementtype 204 31
*createmark elements 2 "all"
*elementsettypes 2



#export .cdb file

*retainmarkselections 0
*createstringarray 1 "HM_MERGELOADS_IN_LOADSTEP "
hm_answernext yes
*feoutputwithdata "D:/Altair/templates/feoutput/ansys/ansys.tpl" "C:/Users/zpc/Desktop/test.cdb" 0 0 1 1 1



The output is "Error:  599412 elements not defined in the template." so it seems like there are something wrong about assigning elements type code segment. But I can export cdb file successfully and display elements in ansys when I did same operation in GUI mode where the commands file record the same code above. Can you guys help me to get it correct? Thx!
 
Status
Not open for further replies.
Back
Top