copy layers and moving objects between layers

copy layers and moving objects between layers

Michael_Ru2
Explorer Explorer
99 Views
1 Reply
Message 1 of 2

copy layers and moving objects between layers

Michael_Ru2
Explorer
Explorer

Hi there,

I’m wondering if anyone can help me write a LISP routine based on the following requirements:

1. Copy layers:
Copy the following layers from the drawing "BCH_Layers - H & R new" to the drawing "create layer":

HE-PANL-DEVC
HE-PANL-DEVC-DGRP
HE-PANL-NMPL
HE-PANL-SPNL
HE-PANL-STEL
HE-CABL-GENL
HE-ANNO-TEXT
HE-ANNO-REVC


2. Move objects between layers in the drawing "create layer":
Move objects from layers Level 1, Level 3, Level 10, Level 13, Level 18, Level 20 to the corresponding layers listed below
HE-PANL-DEVC
HE-PANL-DEVC-DGRP
HE-PANL-NMPL
HE-PANL-SPNL
HE-PANL-STEL
HE-CABL-GENL


3. Copy text styles:
Copy the following text styles from "BCH_Layers - H & R new" to "create layer":

BCH_METR_2.0
BCH_METR_2.5
BCH_METR_3.5

 

4. Update text and mtext styles in the drawing "create layer":
Change all text and mtext with heights of 2mm, 2.5mm, and 3.5mm to use the corresponding text styles:

2mm → BCH_METR_2.0
2.5mm → BCH_METR_2.5
3.5mm → BCH_METR_3.5

 

5. Set annotation layer:
Move all text and mtext objects to the layer HE-ANNO-TEXT.

 

Please see the attached drawings for reference.
Many thanks in advance! šŸ™‚

0 Likes
100 Views
1 Reply
Reply (1)
Message 2 of 2

Sea-Haven
Mentor
Mentor

If you make a list something like this ((oldlayername newlayername color linetype)(repeat as required)....) you can simply make the new  layers, then use the new and old names to change objects layers. Just use a ssget with correct layer filter and then a simple (chprop ss "" "LA" newlayername "")

 

Re text styles again can make a text style using say entmake. reading a list again, for the values required, then can update all text objects style.

 

Hope that helps you get started much easier than reading layers out of another dwg. But if you must, then look at Lee-mac "Steal.lsp" it will do what you ask.

 

Have a go at coding and if you get stuck post code here, plenty will help

 

0 Likes