a.l.e - thanks a lot for the response. Yes, returning a list from unGroupObject() should do the job.<br><br>The most basic example I can think of (for demonstration purposes) is something like this. Suppose I draw a bunch of shapes, get them organized how I want them, then want to do some iterative formatting:<br>
<br>linewidth = 1<br><br>for each Obj in ObjGroup:<br> setLineWidth(linewidth, Obj)<br> setLineColor('Black', Obj)<br> linewidth +=1<br><br>with your suggestion, it would be something like this:<br><br>linewidth = 1<br>
<br>objs = unGroupObj(Group)<br>
for each obj in objs:<br>
setLineWidth(linewidth, obj)<br>
setLineColor('Black', obj)<br>
linewidth +=1<br>
groupObjects(objs)<br><br>I suppose it would be a smidge cleaner to be able to operate on the objects without ungrouping them first, but this is fine if it is easier for you to implement.<br><br>Sorry to convolute the issue, but since I often group different types of objects together another useful function would allow something like this:<br>
<br>linewidth = 1<br>
fontsize = 10<br><br>
for each Obj in ObjGroup:<br> if isRect(Obj):<br>
setLineWidth(linewidth, Obj)<br>
setLineColor('Black', Obj)<br>
linewidth +=1<br>
elif isText(Obj):<br> setFontSize(fontsize)<br> fontsize += 1<br><br>Again, I know these are silly examples, but I hope you get the idea of how this can be a useful function.<br><br>Thanks again!<br><br>-g<br>
<br><br>Date: Thu, 12 Mar 2009 13:58:42 +0100<br>
From: "a.l.e" <ale.comp_06@xox.ch><br>
Subject: Re: [scribus-dev] access members of a group?<br>
To: Scribus Development Mailing List <<a href="mailto:scribus-dev@lists.scribus.info">scribus-dev@lists.scribus.info</a>><br>
Message-ID: <49B90702.8040702@xox.ch><br>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed<br>
<br>
salve<br>
<br>
> I am new to scribus and playing around with the scripter. I am trying to<br>
> write a script that will operate on members of a group of objects. For<br>
> example, I might want to step through each object and increment a color<br>
> setting, some text, etc.<br>
><br>
> Although I can group or ungroup a list of objects, I cant figure out how to<br>
> access each member in the group.<br>
><br>
> Seems like a pretty basic thing to do, am I missing something<br>
<br>
<br>
i guess that the easiest way, would be to return a list of objects from<br>
unGroupObject()...<br>
<br>
<br>
woul it fit your needs?<br>
<br>
ciao<br>
a.l.e<br>