Isolate an include by Include Name

Gokula Krishnan
Gokula Krishnan Altair Community Member
edited October 2020 in Community Q&A

I would like to create a TCL script to isolate an include by an 'include name' in hypermesh.

 

I'm currently able to isolate by include ID. Could you please provide syntax (example) to isolate an include by first 3 digits of an include.

 

I'm expecting something like this.

 

User Input: 500


Searches for an include name which starts with 500_xxxxx. Isolates the include contents.

 

Regards,

Gokul

Tagged:

Answers

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited June 2020

    what about the filtering option in the top area of the browser?

    If you are in the include view of the browser, you could filter by a keyword and get them available.

     

    image.png.95d64766c834ce18d44554c16f393d47.png

  • Gokula Krishnan
    Gokula Krishnan Altair Community Member
    edited June 2020

    Thanks for your reply. Wanted to know if there are any commands to solve this purpose as the user need not switch views to isolate an include.

  • Adriano A. Koga
    Adriano A. Koga
    Altair Employee
    edited June 2020

    I'm sorry, now i saw that you want a script.

     

    I believe you will need to use some combination of commands:

     

    hm_getincludes -byfullname  >> gives you a list of include names in your model

     

    from this list, i would use regular TCL commands to find the particular expression/keyword. (google must have this)

     

    Then, to select all the contents of an include, use hm_getincludeentities, as the example below.

    Example

    To find all of the entities in include 1 and delete them:

     hm_markclearall 1 set ent_types [hm_getincludeentities 1 1] foreach ent_type $ent_types {     catch {*deletemark $ent_type 1} }