🎉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 get assem name of a component

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

hi all,

can anyone pls help me in finding assembly name of a component

 

thanks in advance

 

regards,

JAMIE

Find more posts tagged with

Sort by:
1 - 5 of 51
    User: "llyle_20499"
    New Altair Community Member
    Updated by llyle_20499

    Hello Jamie,

    You can try using the below method, there could be a better way to do too. 
     

    #set the component ID to search:
    set n_compID 18

    set lst_assemblyID [hm_entitylist assembly id]
    foreach assemblyID $lst_assemblyID {
        set lst_componentID [hm_getvalue assembly id=$assemblyID dataname=components];
        if { [lsearch $lst_componentID $n_compID] != -1 } {
            puts 'Component $n_compID is in Assembly [hm_getvalue assembly id=$assemblyID dataname=name]';
        } 
    }

     

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi Jamie,

    You can also try with:

     

    *createmark assems 1 'by comp' compid

     

    hm_getmark assems 1

    User: "tinh"
    Altair Community Member
    Updated by tinh

    :)/emoticons/default_smile.png' srcset='/emoticons/smile@2x.png 2x' title=':)' width='20' /> George, it's the shortest way. I thought it would return parent and grandparent... assems of a comp

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi Jamie,

    You can also try with:

     

    *createmark assems 1 'by comp' compid

     

    hm_getmark assems 1

     hi George,

    this is returning the parent assembly name.

    but i need to return the sub asssembly

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi Jamie,

    You can try with hm_assemlist ~ which will return the hierarchical structure of assemblies.