I'm sure there is a simple solution, but I can't seem to find it.
I have created a group of objects within another group. Group "xGrid" is inside group "plotGroup". How can I reference the objects inside "xGrid"? The following command gives the error (set: missing 'to'), but clearly I have a 'to' in there. Do I need to add parentheses somewhere? Any suggestions would be appreciated.
set the rectangle of graphic "xGrid"&i of grp "xGrid" of grp "plotGroup" to round(x2+x1)/2 , y1 , round(x2+x1)/2 , y2
reference objects inside nested groups
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: reference objects inside nested groups
HI kwinkler,
1. if you have unique names, you will be able to just use the name to address an object.
You DO have unique names, do you?!
2. you MUST use parenthesis when addressing objects with concatenated strings like in your example!
...
set the rectangle of graphic ("xGrid" & i) to round(x2+x1)/2 , y1 , round(x2+x1)/2 , y2
...
Best
Klaus
1. if you have unique names, you will be able to just use the name to address an object.
You DO have unique names, do you?!

2. you MUST use parenthesis when addressing objects with concatenated strings like in your example!
...
set the rectangle of graphic ("xGrid" & i) to round(x2+x1)/2 , y1 , round(x2+x1)/2 , y2
...
Best
Klaus
Re: reference objects inside nested groups
Klaus,
The parentheses seem to have solved the problem. Since the number of objects inside the group frequently varies, it seems like unique names could be cumbersome.
Thanks,
Ken
The parentheses seem to have solved the problem. Since the number of objects inside the group frequently varies, it seems like unique names could be cumbersome.
Thanks,
Ken
Re: reference objects inside nested groups
Hi Ken,
Nevertheless 2 or more objects with the same name can be dangerous!
Best
Klaus
It not only seems, it really doeskwinkler wrote:The parentheses seem to have solved the problem.

Ah, looks like you are creating graphics dynamically, then you are right of course!kwinkler wrote:Since the number of objects inside the group frequently varies, it seems like unique names could be cumbersome.
Nevertheless 2 or more objects with the same name can be dangerous!

Best
Klaus
Re: reference objects inside nested groups
Dangerous indeed, as I have discovered. 
