Error running Hypermesh 2017 with command prompt
Hi,
I have a tcl script to model simple bracket and export Abaqus solverdeck file. My script works fine in Hypermesh command prompt. However, I want to run that script without GUI from command prompt. When I try, I got Error: 'The file being opened for reading does not exist.'
My command : C:\Program Files\Altair\2017\hm\bin\win64>hmbatch -tcl E:\Automatic_Mesh_Generation_Scripts\Mid_to_Export.tcl
My tcl script:
*geomimport 'auto_detect' 'E:/TARIK/Scripts/Hypermesh_Scripting/DENEME_CAD/from_sorhan/ASY-0005865-6C46-6622-BA1_proposal_2.stp' 'CleanupTol=-0.01' 'DoNotMergeEdges=on' 'ImportBlanked=off' 'ScaleFactor=1'
*end_batch_import
*createmark comps 1 'all'
set number_of_component [hm_getmark comps 1]
*createmark surfaces 1 'all'
*midsurface_extract_10 surfaces 1 -1 0 1 1 9 0 20 0 0 10 0 10 -2 undefined 0 0 -3
*deletemark comps 1
*createmark surfaces 1 'displayed'
*createstringarray 1 'breakconnectivity 0'
*hm_batchmesh2 surfaces 1 1 1 'E:/Automatic_Mesh_Generation_Scripts/batchmesh/durability_3mm.criteria' 'E:/Automatic_Mesh_Generation_Scripts/batchmesh/durability_3mm.param'
proc CreateSpiders {args} {
if {[array exists ::hole_nodes] == 1} {
array unset ::hole_nodes
}
*createmark components 1 'all'
set holes_comp [hm_ce_gethmholes 1 20 0 1 0 1]
foreach e $holes_comp {
#puts $e
set s_l [lrange $e 1 end]
set comp_no [lindex $e 0]
foreach h $s_l {
#puts $h
set short_list [lindex [lindex $h 1] 0]
#puts $short_list
lappend ::hole_nodes($comp_no) [lindex [lindex $short_list 0] 0]
}
}
#eval *createmark nodes 1 $hole_nodes
*collectorcreateonly comps 'spiders'
foreach cmpt [array names ::hole_nodes] {
#puts $cmpt
eval *createmark comps 2 $cmpt
eval *createmark nodes 1 $::hole_nodes($cmpt)
*createstringarray 5 'link_elems_geom=elems' 'link_rule=now' 'relink_rule=none' 'tol_flag=1' 'tol=1.000000'
*CE_ConnectorCreateByMark nodes 1 'bolt' 1 components 2 1 5
*clearmark comps 2
}
#realizing the connectors
*createmark connectors 1 'by component' 'spiders'
*createstringarray 4 'ce_notuseijk=1' 'ce_boltmindiameter=0.000000' 'ce_boltmaxdiameter=100.000000' 'ce_systems=0'
*CE_FE_RealizeWithDetails 1 'bolt' 'abaqus' 1001 7 0 20 1 4
*CE_FE_GlobalFlags 0 0
*createmark connectors 1 'by component' 'spiders'
*deletemark connectors 1
}
CreateSpiders
*feoutputwithdata 'C:/Program Files/Altair/2017/templates/feoutput/abaqus/standard.3d' 'E:/TARIK/Scripts/Hypermesh_Scripting/Input/Brakcket.inp' 0 0 1 1 2
Best Answer
-
Hello,
As @tinh suggested, you need some lines at the top of your tcl file, to call HM first.
Below I pasted the block I used in my tcl file, it worked for me but might be different in your case.
Anyway you can find this lines in the command.tcl file created automatically when you launch Hypermesh.
*begin 'version 2017'
*menufilterset '*'
*menufilterdisable
*settopologydisplaymode 0
*settopologydisplaymode 0
*settopologydisplaymode 0
*ME_CoreBehaviorAdjust 'allowable_actions_policy=TC_lite'
*settopologydisplaymode 0
*settopologydisplaymode 0
*elementchecksettings 6 0 0 1 1 6 0 6 0 6 6 6 0 0 0 0 0 0 0 0 0 0 0
*templatefileset 'C:/Program Files/Altair/2017/templates/feoutput/optistruct/optistruct'
*enablemacromenu 1#Import geometry.
...
0
Answers
-
Should be quoted
'C:\Program Files\Altair\2017\hm\bin\win64>hmbatch' -tcl E:\Automatic_Mesh_Generation_Scripts\Mid_to_Export.tcl
0 -
-
Hi,
I could not find solution. Do you have any other idea?
0 -
Try lòading abaqus profile at fist.
0 -
How to do it?
Are there any command for command prompt or .tcl code?
Thanks
0 -
Hello,
As @tinh suggested, you need some lines at the top of your tcl file, to call HM first.
Below I pasted the block I used in my tcl file, it worked for me but might be different in your case.
Anyway you can find this lines in the command.tcl file created automatically when you launch Hypermesh.
*begin 'version 2017'
*menufilterset '*'
*menufilterdisable
*settopologydisplaymode 0
*settopologydisplaymode 0
*settopologydisplaymode 0
*ME_CoreBehaviorAdjust 'allowable_actions_policy=TC_lite'
*settopologydisplaymode 0
*settopologydisplaymode 0
*elementchecksettings 6 0 0 1 1 6 0 6 0 6 6 6 0 0 0 0 0 0 0 0 0 0 0
*templatefileset 'C:/Program Files/Altair/2017/templates/feoutput/optistruct/optistruct'
*enablemacromenu 1#Import geometry.
...
0 -
Thank you FabioC and tinh! Even if there are some error on command prompt window, input file is exported properly.
I changed the begining of the code as you said FabioC. I share same code for Abaqus User Profile below.
*begin 'version 2017'
*menufilterset '*'
*menufilterdisable
*settopologydisplaymode 0
*settopologydisplaymode 0
*settopologydisplaymode 0
*ME_CoreBehaviorAdjust 'allowable_actions_policy=TC_lite'
*settopologydisplaymode 0
*settopologydisplaymode 0
*elementchecksettings 6 0 0 1 1 6 0 6 0 6 6 6 0 0 0 0 0 0 0 0 0 0 0
*templatefileset 'C:/Program Files/Altair/2017/templates/feoutput/abaqus/standard.3d'
*enablemacromenu 1
0