I have some groups, named, say, A,B,C, etc, and I want to group them.
Names of the groups are in an array, eg, gnames[1], gnames[2]...
I thought I could build a string with these group names and put "group" in front of each name, eg
put "group " & quote & gnames[1] & quote & " and group & quote & gnames[2] & quote" into xxx
and then execute : group xxx
This should be the same as doing : group group "A" and group "B" and group "C"
but it fails with a "Chunk: error in object expression"
If I display xxx, it shows : group "A" and group "B" and group "C" which is what I expect.
If I hardcode it, and execute : group group "A" and group "B" and group "C", it works fine.
So it seems I'm doing something wrong in getting (group "A" and group "B" and group "C") into a string and using that string with the group command.
What am I doing wrong please ?
Thanks
groups grrrrr
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: groups grrrrr
Hi Kevin,
there is another possibility to group object! Select all objects and then use the "group" command.
Try this:
Best
Klaus
there is another possibility to group object! Select all objects and then use the "group" command.
Try this:
Code: Select all
...
## 1. First loop thorough all KEYs of your array
repeat for each key tKey in YourGroupArrayHere
## Store the group name in a variable
put YourGroupArrayHere[tKey] into tGroupName
## 2. Select all groups that you want to group
set the selected of grp tGroupName to true
end repeat
## Now the command
group
## De-select everyting
select empty
## Done :-)
...
Klaus
Re: groups grrrrr
Thanks everybody. I implemented Klaus' method and it worked perfectly.