Yet another annoyance with layers

Let's say you have a layer 1 and a layer 2. With layer 2 as the active layer select multiple shapes that are ALL on layer one. Group those shapes and they automatically move to layer 2 or the active layer. Why? I didn't ask for them to be moved. I simply wanted them to be grouped.

  • You have a point most time I just don't use layers
    • You're right, it can be very annoying.
      In my opinion Draw should be able to remember layer position, not only when grouping but also when pasting for example.
      If memory serves me, Macromedia Freehand (later bought by Adobe and sadly killed) had this already in the nineties.
      • Okay with Layer 2 active and all shapes on Layer 1 selected, using this code will group the shapes and retain the layer placement but activates that layer instead of leaving the active layer alone.

        Sub Macro2()
        If ActiveDocument Is Nothing Then End
        If ActiveShape Is Nothing Then Exit Sub
        If ActiveDocument.ShapeEnumDirection = cdrShapeEnumTopFirst Then
        ActiveSelection.Shapes(1).Layer.Activate
        Else
        ActiveSelection.Shapes(ActiveSelection.Shapes.Count).Layer.Activate
        End If
        ActiveSelection.Group
        End Sub
      • Myron,

        Call me crazy but I actually think this is correct behavior. ;-) After all, by definition the ActiveLayer is the Layer you are working on an therefore any changes to shapes not on that Layer will be pulled to it. I know, crazy talk.

        Sub GroupKeepLayer()
            Dim sr As ShapeRange
            Dim l As Layer
            Dim s As Shape
            
            Set sr = ActiveSelectionRange
            Set l = sr.Shapes.First.Layer
            Set s = sr.Group
            s.MoveToLayer l
        End Sub
        

        That said, it is easy enough to code a solution.

        -Shelby

        • Awesome Shelby! I don't usually "undock" the Object Manager so I don't necessarily have the docker visible when I'm working. I have a macro to create a cut layer and once it does that becomes the active layer. So if I continue working and decide I need to group some shapes on layer 1. I don't want them to go to the cut layer. I just need them to stay on the layer they were to begin with.
          • Rather Coreldraw should just switch to Layer 1 as all the selected objects are on that layer? This sounds more like correct behavior to me.. But again ...crazy talk! :)

            Could also turn off Edit across layers.

            • Nope. Tried that. You guys are missing the point. I don't care to use layers, I leave everything on the default which is layer one. And if by chance I have to work with layers I don't want to worry about which is active. I select a bunch of shapes at the bottom it says 15 objects on layer x, great let me group those. Now it says group of 15 shapes on layer y! It would make more sense to me that the default have them stay on the layer they were on to begin with
              • Why not try the option in object manager to restrict your work on single and active layer.

                It is fine like you suggest, if you have selected few objects on any single layer which may be different than the one you are active on. But what should be done in case objects selected for grouping are from multiple layers. Where would a group be placed on ? So IMO it is good to have it the same way it is now.

                Else I think Shelby can add a form/dialog to his code with a choice of Layer names involved in the selected objects and let user select the layer on which the group is expected to be placed.
                • Anand Dixit said:
                  ...But what should be done in case objects selected for grouping are from multiple layers. Where would a group be placed on ?...

                  Ever hear of a soft group? That's what Xara calls it when one wants to group objects from disparate layers and leave them on their respective layers. 

                  I use layers a lot when I am drawing something that needs the organization. Once in a while I get caught out by the issue of this thread. The act of needing to switch active layers in order to act upon an object slows even this tortoise down.

                  In an ideal world I would prefer for object grouping:

                  1. If all selected objects are on one layer, but the active layer is a different one, the objects should remain on their original layer when grouping.
                  2. If selected objects are on different layers then a soft group is automatically done.

                  I'm smart enough to cut and paste objects from one layer to another (or drag them from one layer to another) if I want to move them from on layer to another. But evidently I'm not smart enough all the time to remember what currently happens when grouping objects on a different layer than the active one.