G
Guy..L
If one shape is copied and pasted, it becomes a member of the active layer.
If a group of shapes is copied and pasted, they do not become a member of
the active layer.
Why is this?
Here's the cut and paste with a hack included to handle the groups. I've
extended the Layer class with .Activate
opage = doc.Pages.Add();
opage.Name = "Run";
Layer order = opage.Layers.Add("job");
// copy over all selected shapes
Job.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
order.Activate(true);
opage.Paste(VisCutCopyPasteCodes.visCopyPasteNormal);
// hack because Job for groups doesn't end up in the layer just
activated
Job = opage.CreateSelection(VisSelectionTypes.visSelTypeAll,0,0);
foreach (Shape n in Job)
{
order.Add(n, 1);
}
order.Activate(false);
If a group of shapes is copied and pasted, they do not become a member of
the active layer.
Why is this?
Here's the cut and paste with a hack included to handle the groups. I've
extended the Layer class with .Activate
opage = doc.Pages.Add();
opage.Name = "Run";
Layer order = opage.Layers.Add("job");
// copy over all selected shapes
Job.Copy(VisCutCopyPasteCodes.visCopyPasteNormal);
order.Activate(true);
opage.Paste(VisCutCopyPasteCodes.visCopyPasteNormal);
// hack because Job for groups doesn't end up in the layer just
activated
Job = opage.CreateSelection(VisSelectionTypes.visSelTypeAll,0,0);
foreach (Shape n in Job)
{
order.Add(n, 1);
}
order.Activate(false);