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.
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
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.
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:
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.