Getting total number of elements

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

Hi,

I want to get total number of elements of a model.. Right now I'm marking all elements and using [llength $xyz] getting the total number of elements. But if number of elements are more, then it takes much time.. Is there any other faster approach to get the total count ?

Also, any command for 'elements by attached' ? Should select all the elements attached to it..

Answers

  • Rahul Rajan_21763
    Rahul Rajan_21763 New Altair Community Member
    edited November 2015

    Hi,

    Using Hypermesh GUI you can count no of element using Tools page:count option.

    Extended entity select option provide option for selecting elements by attached element. see screenshot.

    Regards

    Rahul R

    <?xml version="1.0" encoding="UTF-8"?>Tools_count.JPG

    <?xml version="1.0" encoding="UTF-8"?>Extentity entity selection.JPG

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2015

    Hi Rahul,

    Thanks for the reply.. Yes using GUI we can do this, but I want to implement it in a tcl script.. It's not writing anything to command.cmf file either..

  • Rahul Rajan_21763
    Rahul Rajan_21763 New Altair Community Member
    edited November 2020

    Hi,

    Script id 693 in Altair script exchange extract geometry summary.I hope attached tcl file would help you to get the API for same.

    Regards

    Rahul R

    <?xml version="1.0" encoding="UTF-8"?>count.JPG

    Unable to find an attachment - read this blog

  • tinh
    tinh Altair Community Member
    edited November 2015

    Hi,

    using hm_count is faster

    or if you want to count entity in a mark, using hm_marklength

     

    do not use llength [hm_getmark elems 1] because it passes all entity ids into tcl interp slowly

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited November 2015

    Thanks! It worked.

     

    EDIT: Is it possible to move elements present in mark ID 2 to mark ID 1 without affecting elements present already in mark ID 1 ? 

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited January 2019

    Dear all,

     

    can we get different element type present in the one component by using tcl\tk script.

    Like one component have two element type wiz S3 and S4. 

    so can we extract the same info using tcl\tk.

    @tinh pls suggest any API.

     

    Regards,

    Vikas Kumar

  • tinh
    tinh Altair Community Member
    edited January 2019

    Hi Vikas

    Use hm_getconfigtypeincol

    From hm v13 , hm_getvalue is helpfull too.

  • Vikas Kumar_22189
    Vikas Kumar_22189 Altair Community Member
    edited January 2019

    tinh

     

    set var [hm_getconfigtypecountincol comps elems BEAM-6_0 -byname] ;  # is returning (60 9 2)  wiz config id is confusing . 

    How to get again config name by id .

     

    Regards 

    Vikas Kr

     

  • tinh
    tinh Altair Community Member
    edited January 2019

    Hi,

    Use hm_entityinfo.

    I had a post about this