🎉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

Can't import Solver deck into hypermesh via TCL Script

etrud011User: "etrud011"
Altair Community Member
Updated by etrud011

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.

 

<?xml version="1.0" encoding="UTF-8"?>image.thumb.png.0bb0dbf73d8070e5e0d92f1d143b8f3e.png

Find more posts tagged with

Sort by:
1 - 8 of 81
    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    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 '/ ' ?

    etrud011User: "etrud011"
    Altair Community Member
    OP
    Updated by etrud011

    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!'
    }
     

     

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    (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

    etrud011User: "etrud011"
    Altair Community Member
    OP
    Updated by etrud011

    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.

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    Please confirm current dir by command

    pwd

    etrud011User: "etrud011"
    Altair Community Member
    OP
    Updated by etrud011

    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

    etrud011User: "etrud011"
    Altair Community Member
    OP
    Updated by etrud011

    I added 'cd C:/Users/e-tru/Documents ' to my tcl script and I receive no errors anymore.

     

    Thank you

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    Just because I saw C:/Windows/System32

    on your matlab window.