🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to understand *createmark command with a tcl variable list?

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

Hello all,

From the help of *createmark command, it statements as follow:

 

*createmark entity_type mark_id '?option?' list

 

When specifying entity names that contain spaces, group the name using brackets, {Comp name with spaces}, or use a Tcl list.

 

When specifying the list using a Tcl variable, the eval Tcl command must precede the *createmark command (see example below). This expands (substitutes) the Tcl list before executing the command. It is also important to use brackets around any options that contain spaces when using eval (eval *createmark solids 1 {'by comp name'} $comp_names). Otherwise, the quotes will be expanded before the option reaches the *createmark command and it will not function as expected.

 

Why should we use eval command if we use a tcl list? That is to say what's the difference between with eval and without eval command?

 

set names

eval *createmark comps 1 $names  ; # with eval

*createmark comps 1 $names  ; # without eval

 

How to explain above two commands? Thank you

 

Roy

 

Find more posts tagged with