*createlist lines Tcl Modify Command is not working properly

Hypermesh User
Hypermesh User Altair Community Member
edited June 2021 in Community Q&A

While assigning the list of lines(id) to *createlist lines it takes only the first index element of the list.

For example;

Set lineid {101 102 103}

*createlist lines 1 $lineid;

The above Created lines list id 1 should contain three elements 101, 102 & 103

But it always takes only 101 only.

 

Best Answer

  • llyle_22464
    llyle_22464 New Altair Community Member
    edited November 2020 Answer ✓

    Hi Manoj

     

    Use eval to expand the list

     

    eval *createlist lines 1 $lineid

Answers

  • llyle_22464
    llyle_22464 New Altair Community Member
    edited November 2020 Answer ✓

    Hi Manoj

     

    Use eval to expand the list

     

    eval *createlist lines 1 $lineid

  • Viraj Kulkarni_21218
    Viraj Kulkarni_21218
    Altair Employee
    edited November 2020

    Hi Manoj,

    As llyle mentioned please use the eval, here I have added a screenshot of commands and the result.

    The 3 line ids are printed.

    image

  • Hypermesh User
    Hypermesh User Altair Community Member
    edited November 2020

    Hi Manoj

     

    Use eval to expand the list

     

    eval *createlist lines 1 $lineid

    Thanks llyle , Now its working fine,Thanks for your support.

  • Hypermesh User
    Hypermesh User Altair Community Member
    edited November 2020

    Hi Manoj,

    As llyle mentioned please use the eval, here I have added a screenshot of commands and the result.

    The 3 line ids are printed.

    image

    Yes Viraj, I also used eval its working fine.Thanks for checking by spending your valuable time.

  • Saurabh pandey
    Saurabh pandey Altair Community Member
    edited June 2021

    always use eval command id you are calling any $list items..like eval *createmark line 1 $list