Can't import Solver deck into hypermesh via TCL Script

etrud011
etrud011 Altair Community Member
edited October 2020 in Community Q&A

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

Answers

  • tinh
    tinh Altair Community Member
    edited September 2018

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

  • etrud011
    etrud011 Altair Community Member
    edited September 2018

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

     

  • tinh
    tinh Altair Community Member
    edited September 2018

    (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

  • etrud011
    etrud011 Altair Community Member
    edited September 2018

    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.

  • tinh
    tinh Altair Community Member
    edited September 2018

    Please confirm current dir by command

    pwd

  • etrud011
    etrud011 Altair Community Member
    edited September 2018

    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

  • etrud011
    etrud011 Altair Community Member
    edited September 2018

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

     

    Thank you

  • tinh
    tinh Altair Community Member
    edited September 2018

    Just because I saw C:/Windows/System32

    on your matlab window.