Page 1 of 1
Group Command (not control) in script
Posted: Wed May 02, 2012 5:06 pm
by seaniepie
Hi all,
I'm trying to implement the group command but keep getting an error back
Code: Select all
group graphic "Dot_1" and graphic "Dot_2"
Error:
card "PropertyDetails": execution error at line 127 (Group: bad object type), char 1
The dictionary has the syntax 'group [objectList]' and uses the example 'group field "Help" and image "Help Icon" and graphic "Outline"'
This is in v5.5. Any ideas?
Pi
Re: Group Command (not control) in script
Posted: Wed May 02, 2012 5:15 pm
by Klaus
Hi Sean,
I created two graphics "dot_1" and "dot_2" and tested with exactly your script and ended with a group, no errors!?
But I am still using LC 5.02.
Bug in 5.5?
Anyway, I never use this syntax but rather do this, which also works fine in a repeat loop:
...
## Select all objects:
set the selected of grc "dot_1" to true
set the selected of grc "dot_2" to true
## Group them
group
## Deselect them again
select empty
...
Best
Klaus
Re: Group Command (not control) in script
Posted: Wed May 02, 2012 5:26 pm
by seaniepie
Thats brill Klaus,
That will work much better for me anyways as I am creating the dots in a repeat loop and they vary each time the card is loaded. This will be much better to manage.
Thanks. I knew you'd be the one to set me straight

Re: Group Command (not control) in script
Posted: Wed May 02, 2012 5:36 pm
by Klaus
Glad I didn't disappoint you

Re: Group Command (not control) in script
Posted: Wed May 02, 2012 5:48 pm
by seaniepie
Just tried it. Worked a treat

I think the problem with the other way was that they were already part of a group which I wanted to nest. Even if I told the group command that they were part of a group or ignored that and used long id's it still caused a script error. But I'm done now so I tip my hat to you sir.
Pi
Re: Group Command (not control) in script
Posted: Wed May 02, 2012 6:11 pm
by Klaus
Hi Sean,
yep, groups and objects in groups are special kind of beasts!
I think you canot do this without messing with the "editBackground"
property somehow, which I try to avoid whenever possible
Best
Klaus
Re: Group Command (not control) in script
Posted: Wed May 02, 2012 7:00 pm
by jmburnod
Hi,
The two scripts work for me in 5.5.1. (- dp-1 build 1480)
Best
Jean-Marc
Re: Group Command (not control) in script
Posted: Wed May 02, 2012 7:01 pm
by Klaus
Jean-Marc,
please read Sean's last posting...