Skip navigation
1623 Views 7 Replies Latest reply: Jun 8, 2011 11:07 PM by acs_alan RSS
acs_alan Bronze 34 posts since
Dec 9, 2010
Currently Being Moderated

Jun 8, 2011 4:56 AM

UNGROUP SELECTION

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

  • ptc-2092444 Gold 314 posts since
    Aug 8, 2008
    Currently Being Moderated
    Jun 8, 2011 6:48 AM (in response to acs_alan)
    Re: UNGROUP SELECTION

    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.

      • ptc-2092444 Gold 314 posts since
        Aug 8, 2008
        Currently Being Moderated
        Jun 8, 2011 7:53 AM (in response to acs_alan)
        Re: UNGROUP SELECTION

        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?

          • ptc-2092444 Gold 314 posts since
            Aug 8, 2008
            Currently Being Moderated
            Jun 8, 2011 9:08 AM (in response to acs_alan)
            Re: UNGROUP SELECTION

            My mistake. I was thinking that the selection would remain after doing the conversion to elements. I do see that it does break the groups.

             

            I've also tried seeing if there was a way to 'label' a callout and have it carry through the conversion, but no luck.

             

            My suggestion at this point is the one with a little more work. In the end however, it likely is simpler.

             

            1) Make a temp layer.

            2) Select if type is callout.

            3) Move the callouts to the temp layer.

            4) Lock all other layers.

            5) Convert callouts to elements.

            6) Select all.

            7) Group.

            8) Ungroup delete.

            9) Whatever else...

            10) Select all.

            11) Select source layer and unlock.

            12) Move select to layer.

            13) Delete temp layer.

             

            It might be a few more lines of code, but is actually safer as you have quaratined your changes from the rest of your art.

  • PTCEmployee 44 posts since
    Sep 5, 2007
    Currently Being Moderated
    Jun 8, 2011 9:17 AM (in response to acs_alan)
    Re: UNGROUP SELECTION

    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
    

More Like This

  • Retrieving data ...

Bookmarked By (0)

Legend

  • Correct Answers - 3 points
  • Helpful Answers - 1 points