creating components out of sets

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

Hello!

 

I would like to create many components out of many sets. The elements should be moved to the new component and the created component should have the same name as the set.

 

Is that possible?

 

Thanks

<?xml version="1.0" encoding="UTF-8"?>Unbenannt.PNG

Answers

  • Q.Nguyen-Dai
    Q.Nguyen-Dai Altair Community Member
    edited July 2016

    Try my code:

     *createmarkpanel sets 1 'Select sets ' set set_ids [hm_getmark sets 1] *clearmark sets 1  foreach id [lsort $set_ids] { 	set name [hm_entityinfo name sets $id] 	*createentity comps name=$name 	*createmark elems 1 'by set id' $id 	*movemark elements 1 '$name' 	*clearmark elems 1 }

    HTH,

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2016

    Thank you very much!

     

    But I think there is a problem in the While Loop. Hypermesh reports the Error: Please specify a valid collector name.

     

    I've tried the code without the line *movemark elements 1 '$name' and all the components were created fine with the right name.

    So the problem must be the move command in the code.

     

    I am working with HW 14.

     

    That´s the Log:
     

     0     while executing '*movemark elements 1 '$name''     ('foreach' body line 5)     invoked from within 'foreach id [lsort $set_ids] {     set name [hm_entityinfo name sets $id]     *createentity comps name=$name     *createmark elems 1 'by set id' $id     *movemark ...'     (file 'C:/Users/censored/Desktop/test.tcl' line 5)     invoked from within 'source {C:/Users/censored/Desktop/test.tcl}'     ('uplevel' body line 1)     invoked from within 'uplevel #0 'source {$file}''     (procedure '::HM_Framework::p_FileLoad' line 68)     invoked from within '::HM_Framework::p_FileLoad 24'     (menu invoke)

    Thank you!

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2016

    oooh, i think the problem could be my fault!

    Because I fear that it could be that some elements are in more than just one set are deposited.

     

    Is it possible to add to the move line, that the elements should be duplicated?

     

    Thank you!

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited July 2016

    .

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited September 2016

    I ask for help!

     

    Thank you

  • Altair Forum User
    Altair Forum User
    Altair Employee
    edited October 2016

    .