TCL script for min/max in renumber

Saravanan R_20730
Saravanan R_20730 Altair Community Member
edited August 7 in Community Q&A

I am planning to make a script to automate element Id and Node Id viewing of the components present in assembly.

Already same existing in renumber-->min/max

Planning to study that. But unable to get the source code of that script.

Can anyone share or help regarding this

Answers

  • AndreasAltmann
    AndreasAltmann Altair Community Member

    I'm not sure if I got your needs correct.
    But maybe this helps:

    hm_createmark assem 1 "advanced" "all"
    set assemblyIdList [hm_getmark assem 1]
    *clearmark assem
    foreach assemblyId $assemblyIdList {
    set assemblyName [hm_getvalue assem id=$assemblyId dataname=name]
    set compIdList [hm_getvalue assem id=$assemblyId dataname=components]
    puts "Assembly: $assemblyId $assemblyName\n"
    foreach compId $compIdList { hm_createmark elem 1 "by comp" $compId
    set elemList [hm_getmark elem 1]
    set elemListSort [lsort -integer $elemList]
    *clearmark elem 1
    hm_createmark nodes 1 "by comp" $compId
    set nodeList [hm_getmark nodes 1]
    set nodeListSort [lsort -integer $nodeList]
    *clearmark nodes 1
    puts "Comp $compId:\nminElemId: [lindex $elemListSort 0] maxElemId: [lindex $elemListSort end]\nminNodeId: [lindex $nodeListSort 0] maxNodeId: [lindex $nodeListSort end]"
    }
    }

    }