TCL Scripting

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

Hello everyone,

i am new to Tcl programming and worked little bit with command.tcl file to create simple scripts. But now I would like to create a script with the help of if loop. I wanted the script automatically create the solids with bounding surfaces option and if the solids already exist in the model then to return. Can someone help me with this?

 

I could only come out with this.

 

*createmark surfaces 1 'displayed'
*solids_create_from_surfaces 1 4 -1 2

 

Thank s and regards,

Punith

Answers

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited January 2018

    Hello Punith, 

     

    You can try the below,


    *createmark surf 1 'displayed'
    catch {*solids_create_from_surfaces 1 4 -1 2} status;
    if {$status == 1} {
        puts 'Solid Created Successfully';
    } else {
        puts 'Solid Creation Failed';
    }

     

    to create using loops, please give more information. 

     

  • Punith
    Punith Altair Community Member
    edited January 2018

    Hello Livillyle,

    thank you for the quick reply. Your code helped me.

     

    Thank you so much.

     

    Regards,

    Punith

  • llyle_20499
    llyle_20499 New Altair Community Member
    edited January 2018

    Welcome! Glad it helped.

  • Punith
    Punith Altair Community Member
    edited January 2018

    Can you tell me where to find expressions like catch and using IF function?I searched a lot in Hypermath help files but unable to find it.

     

    Thanks and regards,

    Punith

  • Punith
    Punith Altair Community Member
    edited January 2018

    wow really helped a lot.

    Thank you so much

     

    Regards,

    Punith

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited March 2020

    Hello every one

    i would like to know the script for finding out the top most & bottom most z co-ordinates of the nodes that exists in the hypermesh model

    Please some one help me

     

    Thanks & regards

    zaheer