How to edit card element - Automatic ( convert from Blank to OFFSET )

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hello everybody .

Please support for me !

For example, i have 5 components and set properties . I want to edit card element . Convert option from BLANK to OFFSET . Offset value = 1/2 thickness of component . Then show 2D detailed to check Thickness . 

How to write a tool tcl to perform that operation ? 

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited April 2019

    Hi,

     

    Open command.tcl in your working folder (mostly Documents) delete all the commands, now do the above operation in Hypermesh, the tcl commands to do the same operations will be written in command.tcl. try running each line by line to understand what is going on, then add some more tcl commands and api to automate it. 

     

     

  • Pandurang
    Pandurang Altair Community Member
    edited April 2019

    *createmark prop 1 all;
    foreach pid [hm_getmark prop 1] {

        *setvalue props id=$pid STATUS=2 1819 = 1
        set offsetvalue [expr 0.5 * [hm_getvlue prop id = $pid dataname = thickness]];
        *setvalue props id=$pid STATUS=2 1821 = $offsetvalue;

    }
    *clearmark prop 1;

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2019

    *createmark prop 1 all;
    foreach pid [hm_getmark prop 1] {

        *setvalue props id=$pid STATUS=2 1819 = 1
        set offsetvalue [expr 0.5 * [hm_getvlue prop id = $pid dataname = thickness]];
        *setvalue props id=$pid STATUS=2 1821 = $offsetvalue;

    }
    *clearmark prop 1;

     

     

     

    This command is not working

  • Pandurang
    Pandurang Altair Community Member
    edited July 2019

    don't just copy paste...

    write it down

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2019

    How please gives a brief explanation for this script and how to write down