Move each surface to different components

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

Hello All,

I am new to Tcl scripting ,require your help for moving each surface into a different component by its name 

*createmark surfaces 1 'displayed'
foreach s [hm_getmark surfaces 1]  {        
set compname[ hm_getentityvalue surfaces $s collector.name 1 ] 
 It is reading the name of collector but not recognizing the variable compname .

Please hlp

 

Answers

  • tinh
    tinh Altair Community Member
    edited July 2017

    OK. this is an easier way:

     *createmark surfs 1 displayed; # or *createmarkpanel surfs 1 'Select surfs:' foreach SurfId [hm_getmark surfs 1] {       set CompName [hm_getentityvalue surfs $SurfId collector.name 1]       *collectorcreateonly comps ${CompName}_$SurfId '' [expr round(rand()*63)+1]       *createmark surfs 1 $SurfId       *movemark surfs 1 ${CompName}_$SurfId }

     

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2017

    Appreciate your help ,it worked