Jump to content

duplicate/delete layers


Recommended Posts

To duplicate a design layer: create the new layer, then go back to the old layer, SelectAll, and copy everything, then go to the new layer and paste in place.

 

Use:

vs.Layer('New Layer Name')

vs.Layer('Old Layer Name')

vs.SelectAll()

vs.DoMenuTextByName('Copy', 0)

vs.Layer('New Layer Name')

vs.DoMenuTextByName('Paste In Place', 0)

 

You may need to check my syntax. I didn't.

 

Raymond

  • Like 1
Link to comment

Yes you can delete layers.  Sorry this is VS instead of Python.

 

Procedure Test;

VAR	H1: Handle;

BEGIN
	H1:=ActLayer;
	Layer(GetLName(FLayer));
	DelObject(H1);
End;

Run(Test);

 

You probably want to get fancier and do error checking.  Make sure you are not trying to delete the last layer. Make sure that the layer you are trying to delete is not the First Layer. You may also want to consider if you are using the active layer if you really want to change the active layer to the first layer or if you want to do the work to set the next or previous layer to be active instead.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...