🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

TCL script *createmark problems

User: "etrud011"
Altair Community Member
Updated by etrud011

Hello,

 

I have a tcl script that uploads an FEM using ossmooth into hypermesh. Then two shrinkwraps are applied on the new iso-surface and the resulting mesh is exported as an stl file. The problem is when I call my script from the command prompt; hypermesh fails to locate elements by their property id. When I run the script in the hypermesh console no errors occur. Can anyone help me determine what is causing this strange behavior?

 

The string sent to the command prompt is written as:

 

'C:\Program Files\Altair\2019\hm\bin\win64\hmopengl.exe' -tcl 'C:/Users/Eric/Documents/script.tcl'

 

I cannot post the model because of work reasons. The script is below, the path names need to be updated with local file names:

 

#the property id to locate design elements

set design_id 23

#the voxel size for shrink wrap
set wrap_size 0.0500000000

# .fem file path

set fem_name 'temp_name'

# shape file results

set sh_name 'temp_sh_name'

# the stl output path

set stl_name 'tmp_stl'
#upload the file for fea re-anlalysis
*createstringarray 2 'isosurf: 3 3 0.500000 0 -1 0 0 10 30 1 0' 'other_params: 1 0 0 0 10 0'
if { [ catch {*ossmooth_12 0 1 0 1 $fem_name $sh_name '' 1 0 1 2} ] } {
puts 'Error Extracting ISO-Surface...'
}
#mask all
puts 'Creating New Component'
#create a new compoenet for the shrinkwrap
set comp_name_1 'component1_lattice_wrap1'
*createentity comps includeid=0 name=$comp_name_1
puts 'Applying Shrinkwrap 1'
#do the shrink wrap on the displayed elements
*currentcollector components $comp_name_1

#

# Script Error from command prompt

#
*createmark elems 1 'by property id' $design_id

#

# Script Error

#
*shrinkwrapmesh elements 1 2 $wrap_size 30 3 0 0 0 0 0 0
puts 'Applying Shrinkwrap 2'
#make another component for the second wrap
set comp_name_2 'component1_lattice_wrap2'
*createentity comps includeid=0 name=$comp_name_2
*currentcollector components $comp_name_2
*createmark elems 1 'by component name' $comp_name_1
*shrinkwrapmesh elements 1 2 $wrap_size 30 3 0 0 0 0 0 0
#divide the elems into triangles
*createmark elems 1 'by component name' $comp_name_2
*splitelements 22 1
#export to STL into the predefined path
puts 'Printing the STL file'
*createmark elems 1 'by component name' $comp_name_2
*createstringarray 2 'CONNECTORS_SKIP' 'HMMATCOMMENTS_XML'
hm_answernext yes
*feoutputwithdata 'C:/Program Files/Altair/2019/templates/feoutput/misc/triasto.stl' $stl_name 0 0 0 1 2

 

 

Thank you,

-Eric

 

Find more posts tagged with