🎉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

How to change working directory

Hi,

 

 

My objective was to take images of components and save it in a folder.

I used the following command to take the image

 

*jpegfilenamed $compname

 

But the problem is it is saving all those files in 'MY DOCUMENTS' which is working directory.

 

hm_info -appinfo CURRENTWORKINGDIR

 

By using the command i can able to retrieve the working directory.

 

I used the following command to change the working directory but it is not working

 

set CURRENTWORKINGDIR 'C:\folder'

 

Help me on this.

 

 

Find more posts tagged with

Sort by:
1 - 7 of 71
    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    hi Karthi

    use 'cd' command

    cd 'C:/folder'

     

    but you already use *jpegfilenamed so it's better to direct path in filename:

    *jpegfilenamed 'C:/folder/$compname'

    Thanks for the Reply!!!

    I have to check if component is not there it has to come out of the program.. For that i used the following command.

     

    if {$comp == ''} {
    break
    }

    But it is showing a  HM error message as    ' invoked 'break' outside of a loop '

     

    it should not tell any error message it should come out without it..

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    hi,

    the error is invalid using of 'break'

    you ough to use 'return'

    Thanks for the Reply!!!

     

    I need to use the translate option like moving the elements in mark 1 from N1 to N2

     

    Ex:

     

    *createmark elements 1 displayed

    *createvector  1 0.7085 -1.6000 0.0001
    *translatemark elements 1 1 0.2

     

    Like this it is coming in CMF file. how do i get the vector for 2 nodes.

     

     

    I also want to get the coordinates of a node. when i try the following option it is saying it can be used only for points.

     

    hm_getcoordinates points 1

     

    How do i create the points for the nodes in mark.

     

    Thanks in Advance!!!

    tinhUser: "tinh"
    Altair Community Member
    Updated by tinh

    hi,

    to get coordinates of a node you can use hm_nodevalue:

    foreach {xcoord ycoord zcoord} [expr [hm_nodevalue $NodeId]] {}

    and from coordinates of 2 nodes you can get a vector by (x2-x1) (y2-y1) (z2-z1) (or using utilitiy function in hwat - please look at help about hwat)

    Thanks.. i got the coordinates.. but the problem is i need the X,Y,Z values in different variables ..

     

    set cor [hm_nodevalue $nodeId]
    set x [lindex $cor 0]
    set y [lindex $cor 1]
    set z [lindex $cor 2]

     

     

    When i use this i m getting the whole X,Y,Z in Variable x itself. Help me on this!!!

    Sorry i did't use the full line before... i got it thanks...