Jump to content
Developer Wiki and Function Reference Links ×

Is there a way to Duplicate and rename a layer?


Recommended Posts

Procedure Test;

Var H1 : Handle;

S1 : String;

Begin

H1:=ActLayer;

S1:=concat(GetLName(H1),Date(2,2));

H1:=CreateLayer(S1,1);

End;

Run(Test);

Will give you a layer with the same scale and different name than the active layer. It looks like you will have to script the transfer of Z, delta Z, and layer colors if that is important.

Link to comment

Thanks Pat, but unfortunately it didn't work the way I had hoped. I was hoping that all the content on the layer would be duplicated as well.

Another solution to my current problem would be to copy and paste in place a symbol.

I have a drawing border with a title block that is on Layer A. Unfortunately if I place the symbol on a new layer it loses its Linked Record capabilities. I'm hoping if I copy and paste the drawing border it will retain its linked record.

I guess a 3rd solution would be to just place a new drawing border on the design layer.. i dont know if this is possible.

Link to comment

currently i'm researching DoMenuTextByName and NNA:Menu Selectors possibly this is the route for me to take...

I think my main problem is figuring out a way to activate the Drawing Border so I can copy it.

maybe i can just activate the layer, setselect the drawing border and title block, then paste it on the other layer... i just don't know how to reference the drawing border and title block.

Possibly a SelectAll will work...

Edited by MaxStudio
Link to comment

Ok the following worked:

Procedure Test;

Begin

Layer('A-01');

SetLayerOptions(4);

SelectAll;

DoMenuTextByName('Copy',0);

Layer('A-02');

DoMenuTextByName('Paste In Place',0);

End;

Run(Test);

The next step is finding a way to reference the number of saved views that exist in the file. Each saved view needs its own design layer with a title block. So i need to figure out a way to reference the number of saved views so I can correctly number my layers.

Is this confusing?

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