Jump to content
tbaldan

Error running Hypermesh 2017 with command prompt

Recommended Posts

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

 

 

Share this post


Link to post
Share on other sites

Hello Tinh !

 

Thanks for reply, I tried quoted  command as:

"hmbatch" -tcl E:\Automatic_Mesh_Generation_Scripts\Mid_to_Export.tcl

 

but I encountered errors shared below. Are there an error in my script shared with older post?

image.thumb.png.f12974757967c3b5a7ce54f0752d70a3.png

 

 

 

 

Share this post


Link to post
Share on other sites

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.

...

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...