Jump to content
etrud011

Can't import Solver deck into hypermesh via TCL Script

Recommended Posts

Hello,

 

I have a script that I call from MATLAB. The script is called from the command prompt which opens Hypermesh and uploads a solver deck into the Hypermesh gui. The problem I face is that the .fem file does not upload into Hypermesh as long as MATLAB is running its own script. 

Also, importing any other solver deck into Hypermesh does not work either unless MATLAB is paused or by starting a new instance of Hypermesh.

 

The code used to upload the fem file is here;

 

#threshold values
set solid_domain_threshold 0.694147

#osmooth constrols

set surfacecode 2
set laplacian_iteration 20
set laplacian_feature_angle 25
#"isosurf: surfacecode1 surfacemode2 densitythreshold3 detectbridge4 lowthreshold5 distancecoefficient6 optismoothboundary7 lapiteration8 lapfeatureangle9 lapsmoothboundary10 drawrecovery11"

puts "Uploading Solid Domain "

*createstringarray 2 "isosurf: $surfacecode 3 $solid_domain_threshold 0 -1 0 0 $laplacian_iteration $laplacian_feature_angle 1 0" "other_params: 1 0 0 0 10 0"
if { [ catch {*ossmooth_12 0 1 0 1 "C:////Users////////Large Tension Hinge Rebuilt 2.2 Stage 2 Initial_1.fem" "C:////Users////Large Tension Hinge Rebuilt 2.2 Stage 2 Initial_1.sh" "" 1 0 1 2} ] } {

puts "Error During Solid Domain Tetmeshing"

} else {
puts "Solid TetMesh Succesful!"
}
 

What could be the source of the problem? I am running on Windows 10 home edition.

 

Thank you

 

A screen shot is provided to visualize the problem a little bit better.

 

image.thumb.png.0bb0dbf73d8070e5e0d92f1d143b8f3e.png

Share this post


Link to post
Share on other sites

did you verify file path 'C:////Users////////Large Tension Hinge Rebuilt 2.2 Stage 2 Initial_1.fem' ?

folder path & file name should not contain space. why did you type many '/ ' ?

Share this post


Link to post
Share on other sites

Hi tinh,

 

The file path is verified, the one written in my first post was shortened. I removed all the spaces in the file name and path and still receive errors. If I copy paste the same code from the tcl script , it works just fine. It does not work if the script is called from the command prompt. Four slashes where used because some of the tcl script is printed from matlab.

 

After rewording the tcl script this error shows up:

image.png.0e745b38709db379ac15f06b0fe5219e.png

I am not sure why this is happening (Encountered error (check read/write permissions and file existence)). The script looks like this;


#########################
#upload the solid layers#
#########################

puts "Uploading Solid Domain"

*createstringarray 2 "isosurf: 1 2 0.7 0 -1 0 0 10 30 1 0" "other_params: 1 0 0 0 10 0"
*ossmooth_12 0 0 2 1 "C:/Users/e-tru/Documents/Altair/Practice/Mult_objective_Stage_2_Practice/Large_Tension_Hinge_Rebuilt_2.2_Stage_2_Initial_1.fem" "C:/Users/e-tru/Documents/Altair/Practice/Mult_objective_Stage_2_Practice/Large_Tension_Hinge_Rebuilt_2.2_Stage_2_Initial_1.sh" "" 1 0 1 2

puts "Error During Solid Domain Tetmeshing: Refining Mesh"

} else {
puts "Solid Domain TetMesh Succesful!"
}
 

 

Share this post


Link to post
Share on other sites

(Encountered error (check read/write permissions and file existence)). => look like current working directory is read-only (Program Files , Windows, ...)

 

The file being opened for reading does not... => file reading failed ( file not existing, not readable, invalid data content or emptied)

 

please verify

Share this post


Link to post
Share on other sites

I've made all my folders readable. The file also exists, I improperly wrote the path in my second post.

The problem still persists. It might have something to do with my environment variables when I am inside the command prompt that is initialized by matlab.

Share this post


Link to post
Share on other sites

The current directory when I start hypermesh normally is;

C:/Users/e-tru/Documents

 

When hypermesh is called from the matlab command string the directory changes to:

C:/Windows/System32

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...