Duplicating Multiple Layers with

Duplicating Multiple Layers with

Anonymous
Not applicable
6,393 Views
9 Replies
Message 1 of 10

Duplicating Multiple Layers with

Anonymous
Not applicable

I'm looking for a way to duplicate multiple layers at once, maintaining all their properties and just changing one letter in the name. Possible?

For example,

 

UNIT_A_CROWN

UNIT_A_FRAME

UNIT_A_FACING

UNIT_A_BASEBOARD

 

Duplicated with new names

 

UNIT_B_CROWN

UNIT_B_FRAME 

 

ect. 

thanks

0 Likes
Accepted solutions (1)
6,394 Views
9 Replies
Replies (9)
Message 2 of 10

rkmcswain
Mentor
Mentor
And keep them in the same drawing file? You could isolate those layers, wblock them out to a new file, open that one, rename, then insert this block back into the original.

If this is something you need to do often, it could be automated with lisp, etc.

R.K. McSwain     | CADpanacea | on twitter
0 Likes
Message 3 of 10

ВeekeeCZ
Consultant
Consultant
Copy/Paste some object in those layers to new drawing.
Rename
UNIT_A_*
to
UNIT_B_*
copy/past back aside, delete objects.
0 Likes
Message 4 of 10

Alfred.NESWADBA
Consultant
Consultant

Hi,

 

I would use DesignCenter to drag & drop these layers to a new drawing, then in the new drawing rename the layers (manually or using command _RENAME if possible).

When they are finished again use DesignCenter to drag & drop these layers from the temporary dwg to the original one.

 

HTH, - alfred -

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2025
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 5 of 10

Kent1Cooper
Consultant
Consultant
Accepted solution

@Anonymous wrote:

I'm looking for a way to duplicate multiple layers at once, maintaining all their properties and just changing one letter in the name. ....

 

UNIT_A_CROWN

UNIT_A_FRAME

.... 

Duplicated with new names

 

UNIT_B_CROWN

UNIT_B_FRAME 

....


Try this [lightly tested]:

 

(foreach lay '("UNIT_A_CROWN" "UNIT_A_FRAME" "UNIT_A_FACING" "UNIT_A_BASEBOARD")
  (setq ldata (entget (tblobjname "layer" lay)))
  (entmake (subst (cons 2 (vl-string-subst "_B_" "_A_" lay)) (assoc 2 ldata) ldata))
)

 

It assumes the Layers in the list are in the drawing, but it could be made to check that for each one, and make the _B_ ones only for those _A_ ones that exist.

Kent Cooper, AIA
Message 6 of 10

rhgrafix
Enthusiast
Enthusiast

For Single Layer:

Today I discovered a weird trick, type -, anywhere in a layer name and it makes an exact copy underneath it with the dash added. (I use Acad 2018 so I can’t vouch for older versions).

Then add your unique text: eg. Calendar_Month_Headers - add a dash and comma with no space:

Calendar_Month_Headers-,  you end up with: Calendar_Month_Headers-  then add your text, or put at beginning like -,Calendar_Month_Headers  you will get -Calendar_Month_Headers

For Multiple Layers:

Press Alt+S in your layers manager or type LAS at command line, export layers list to; eg. mytest.las, open with text editor, copy your sections and rename there, save, import back to drawing. Technically you leave your drawing but you don’t need a second drawing, I realize these are funky workarounds but until Autodesk follows forums, sees years of us asking for stuff and not fixing them (they do fix some of them), we have to do this stuff. Hope this helps,

R.L. Hamm

Message 7 of 10

Anonymous
Not applicable

Thanks! That's a useful trick to know. I usually just highlight the layer I want to copy properties of and click 'new layer' but you still need to rename that new layer from 'layer1' to the new name in that case.

Message 8 of 10

ВeekeeCZ
Consultant
Consultant

Yes, the workflow is pretty simple - confirm a new name with comma key instead of enter.

Reference HERE

 

Message 9 of 10

rhgrafix
Enthusiast
Enthusiast

Hmm, so that is a thing, I thought I found some weird anomaly.

0 Likes
Message 10 of 10

ВeekeeCZ
Consultant
Consultant

Well, it's one of those many less/un known tricks that autocad have. Undocumented, but intentional behavior.

You definitely deserve kudos for the discovery.

 

IMHO what is weird is that comma key. Why a comma key?! I can imagine that combinations like CTRL+Enter or Shirt+Enter would be better.

0 Likes