🎉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

Python

User: "Beta"
New Altair Community Member
Updated by Beta

Hi,

 

I am using Motion View and I know that is able to use Python to customize in Motion View. 

Is there any chance to do the same thing with HyperMesh. I want to use Python because it, somehow quicker and more simple, also.

 

Find more posts tagged with

Sort by:
1 - 9 of 91
    User: "Merula_20758"
    Altair Community Member
    Updated by Merula_20758

    SO +1 for this.

    I know there were plans for a complete python interface but as far as I know its not under development currently, so you have to stick with .tcl scripting which is ok.

    Best regards

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    Never hear about Python in Hypermesh. But why need Python when you can do almost everything with Tcl/Tk ?

    User: "Beta"
    New Altair Community Member
    OP
    Updated by Beta

    Well, that is exactly to say you can do almost everything with TCL/Tk. But sometimes, when I have to handle big model with a lot of parts and there are many loops in my scripts, TCL runs too long. Some friends told me, python can process loops faster and easier to manage big program. I found some python source code in HM setup folder so there a question comes up in my mind :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> 

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Well, that is exactly to say you can do almost everything with TCL/Tk. But sometimes, when I have to handle big model with a lot of parts and there are many loops in my scripts, TCL runs too long. Some friends told me, python can process loops faster and easier to manage big program. I found some python source code in HM setup folder so there a question comes up in my mind :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> 

     

    Hi.

    Show us your slow codes. We may help it faster .

    if you have to summary big model, we may embed some hm native template codes into tcl

    if you have to calculate complex math expression, we may embed some hm templex codes into tcl

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    if you have to summary big model, we may embed some hm native template codes into tcl

    Ahhh, it sounds interesting here :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> How? Example?

    Thanks

     

    User: "tinh"
    Altair Community Member
    Updated by tinh

    ^_^/emoticons/default_happy.png' srcset='/emoticons/happy@2x.png 2x' title='^_^' width='20' />

    You can find a lot of hm template example to summary data in folder ../altair/.../templates/summary

    those can summary cog, moi,... of comps or other entities

    if we loop through big data and use hm_getentity... to access data, use expr to calculate, or * commands, it is very slow

    but looping by template, it is very fast.

    example i have to check face-face angle of solid elems, tcl can do:

    foreach elemid $elemlist3d {

        set angle [p_calculateFaceFaceAngle $elemid]

        if {$angle>$criteria} {lappend failedlist $elemid}

    }

    => it's slow with plenty of solid elems

    now using template:

    set TplString {

    *elements(204,,,)

         //calculate angle...

         ...

         *if([#angle>#criteria])

              *markfailed()

          *endif()

    *output()

    }

    #write it to a text file

    set fpt [open demo.tpl w]

    puts $fpt $TplString

    close $fpt

    #call template processor

    *usercheck demo.tpl demo.out 0

     

    => so hm will loop through elems and calculate angle (very fast), tcl just calls template processor

     

     

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    Thanks :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' />

    User: "Merula_20758"
    Altair Community Member
    Updated by Merula_20758

     

    Hi.

    Show us your slow codes. We may help it faster .

    if you have to summary big model, we may embed some hm native template codes into tcl

    if you have to calculate complex math expression, we may embed some hm templex codes into tcl

    Super interested in this. !!

     

    User: "Beta"
    New Altair Community Member
    OP
    Updated by Beta

    Super amazing, you are the best :)))