Skip to main content
1-Visitor
June 8, 2011
Solved

UNGROUP SELECTION

  • June 8, 2011
  • 2 replies
  • 4572 views

Hello everyone,

Ok I have a little problem, if anyone has any suggestions I would be happy to hear them.

Goal

In a pre-existing illustration I wish to take current callouts (generated using the callout tool) and break them down into elements, remove the rectangle (with white fill), and shorten the line so it no longer intersects the number (the rectangle provides a shadow effect around the number).

Progress

So far I have selected all callouts and converted into elements. This puts each callout into a group, I Select All and using the FirstSelectedElement mixed with the 'UNGROUP SELECTION' (cannot get the optinoal parameter DEEP to work) function Isodraw 7.1 crashes. Can anyone provide a different solution/fix?

I have tried to avoid using FirstSelectedElement and Select All and I am trying to find a way to select each group individually using a loop (I think when Ungroup Selection is executed whilst multiple groups are selected Iso crashes) but I cannot find a way of selecting group individually.

MACRO Callout_to_Elements

DEFINE el as Element

SELECT IF type IS "callout"
CONVERT SELECTION INTO ELEMENTS
SELECT ALL
el = ActiveDoc.FirstSelectedElement

While (Exists(el) = True)
If (el.Type = "Group") && (el.lastChild = "line") Then # lastChild ensure a group that previosuly was a callout is selected and not another group

UNGROUP SELECTION
End If

el = el.NextSelectedElement
el = el.NextSibling
End While

END MACRO

Oh I am not expecting to shorten the line that intersects the number, I assume this will have to be done manually which I am happy with.

Many thanks for the help.

Alan

    Best answer by bgraffmann

    Hi.

    Your macro is running into an endless loop, if there was more than one group.

    You can stop it by holding the "End" key pressed for a while.

    I modified your macro a bit, so that it starts over for all groups after it ungrouped

    a former callout. This is going to be very slow with many callouts, but at least it's

    not endless:

    MACRO Callouts_to_Elements

    DEFINE el as Element

    SELECT IF type IS "callout"
    CONVERT SELECTION INTO ELEMENTS
    SELECT ALL
    el = ActiveDoc.FirstSelectedElement
    WHILE (Exists(el) = True)
    IF (el.Type = "Group")
    IF ((el.lastChild.Type = "Line") && (el.firstChild.Type ="Text"))
    UNGROUP SELECTION
    SELECT ALL
    el = ActiveDoc.FirstSelectedElement
    ELSE
    el = el.NextSelectedElement
    END IF
    ELSE
    el = el.NextSelectedElement
    END IF
    END WHILE

    END MACRO

    2 replies

    12-Amethyst
    June 8, 2011

    If I am understanding correctly, you are attempting to cycle through each group and then ungroup. If this is correct, do this instead.

    1) Select your groups as you had originally.

    2) Group all these groups into one group.

    3) Ungroup deep.

    I learned the hard way in IsoDraw 7.0 that ungroup only works on a single group. I had to do the above mentioned to handle something I was working on as well.

    acs_alan1-VisitorAuthor
    1-Visitor
    June 8, 2011

    Thanks Trevor answering your a legend!

    Nice way of approaching the situation. It works like you said, although another problem is other groups may be on the same layer as the callouts so select all will select groups that are not meant to be ungrouped.

    Ideally I can think of 2 approaches:

    1. Select all callouts before breakign and move to a Temp layer, lock other layers, convert callouts to elements, select all groups, group, select all, ungroup deep.
    2. Select each callout group individually (via a logical filter - see IF in code above), then executing ungroup on each group in turn.

    My thoughts are 1 is the likely choise as I am pretty sure it can be done, although its a bit of work. Is number 2 possible?

    Thanks

    Alan

    12-Amethyst
    June 8, 2011

    Would this change to #1 work for you?

    • 1) Select all callouts before breaking, convert callouts to elements, group, ungroup deep.

    In regards to #2, yes you could select if type is callout. Instead of cycling through, couldn't you just group them and then ungroup deep?

    1-Visitor
    June 8, 2011

    Hi.

    Your macro is running into an endless loop, if there was more than one group.

    You can stop it by holding the "End" key pressed for a while.

    I modified your macro a bit, so that it starts over for all groups after it ungrouped

    a former callout. This is going to be very slow with many callouts, but at least it's

    not endless:

    MACRO Callouts_to_Elements

    DEFINE el as Element

    SELECT IF type IS "callout"
    CONVERT SELECTION INTO ELEMENTS
    SELECT ALL
    el = ActiveDoc.FirstSelectedElement
    WHILE (Exists(el) = True)
    IF (el.Type = "Group")
    IF ((el.lastChild.Type = "Line") && (el.firstChild.Type ="Text"))
    UNGROUP SELECTION
    SELECT ALL
    el = ActiveDoc.FirstSelectedElement
    ELSE
    el = el.NextSelectedElement
    END IF
    ELSE
    el = el.NextSelectedElement
    END IF
    END WHILE

    END MACRO

    acs_alan1-VisitorAuthor
    1-Visitor
    June 9, 2011

    Hi guys,

    Thanks for the assistance, bgraffman it worked perfectly, I am just trying to learn from your code - thanks. Trevor cheers for the assistance, the method you have described is similar to what I was going to do if no solution was resolved, and moving the callouts from other elements does have a distinct advantage although for this project I think the Logical filter on the IF statement is solid for this project but for others may not be so easy.

    Thanks

    Alan