create cross section (Hypermesh 14) using tcl

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

Hey all,

 

I am trying to create several sections automatically with a tcl script. I have organized all of my parts into a Part Set, which  I would likey to use as the basis for the section. The concern that I have is that the only way I can get this to work is through the GUI which enacts the following command:

 

*setvalue crosssections id=6 VisualizationPart_ID={sets 3}

 

The remainder of the section definition works well as follows:

 

*setvalue crosssections id=8 name=boltk geometrytype=3 basenode={0 10 152.525} normal={0 0 1} Radius=1 PartSet_ID=1

 

The difficulty in using 'VisualizationPart_ID' is that the given ID (sets 3 in this case) refers to the third set in the panel that pops up (also the thid set in the Sets Tree). I wont necessarily know how many sets are pre-existing in a given model, and therefore I need a means to pick the actual Set ID, which I can define myself previously in the script.

 

Has anyone had this issue before?

 

ANy workaround?

 

 

 

http://www.altairhyperworks.com/hwhelp/Altair/hw14.0/help/hwd/hwdref.htm?data_names-crosssections.htm

Tagged:

Answers

  • tinh
    tinh Altair Community Member
    edited March 2017

    Hi,

    when you have just created a set, catch its ID by:

     

    #creating set named 'My Set'

    set MySetID [hm_latestentityid sets]; #=> ID of 'My Set'

     

    so when you assign it to crosssection, refer to MySetID instead of picking it:

    VisualizationPart_ID=