Change layer for a large number of objects

Change layer for a large number of objects

Yuan_LiuTUF66
Observer Observer
1,273 Views
10 Replies
Message 1 of 11

Change layer for a large number of objects

Yuan_LiuTUF66
Observer
Observer

Hello all, I have a dwg containing large number of objects (probabaly >500000) and they are on different layers with differenct line type etc. 

Now I need to move all objects to one layer, when I select more than 32767 objects (max. you can set in AutoCAD), I cannot use the property window (MO) to change layer anymore. 

 

So the only way I have now is to select a small portion of the dwg to make sure total number of objects not exceed 32767 at a time, then change the layer. But this takes a lot of time. 

 

I believe there should be a better way to do this, your idea is very welcome.

Many thanks and regards,

Yuan

 

 

0 Likes
Accepted solutions (1)
1,274 Views
10 Replies
Replies (10)
Message 2 of 11

ChicagoLooper
Mentor
Mentor

Hello @Yuan_LiuTUF66 

What are the objects? Points? Lines? Polygons? Text? Hatch? Blocks? If you want a good answer, you'll need to provide a good description.

 

Can you share your drawing file?

Chicagolooper

EESignature

0 Likes
Message 3 of 11

doben
Collaborator
Collaborator

You can do it with the "change" command. 

 

Select objects:
Specify change point or [Properties]: p

Enter property to change [Color/Elev/LAyer/LType/ltScale/LWeight/Thickness/

 

 

0 Likes
Message 4 of 11

RSomppi
Mentor
Mentor

Merge the layers to the desired one.

Message 5 of 11

rkmcswain
Mentor
Mentor

Note if you have items in blocks they will not be changed. But I suspect the layer merge idea would take care of that 😉

R.K. McSwain     | CADpanacea | on twitter
Message 6 of 11

pendean
Community Legend
Community Legend

@Yuan_LiuTUF66 wrote:

... make sure total number of objects not exceed 32767 at a time, then change the layer. But this takes a lot of time. ...

 


That's just a display limit so your computer does not lock up: you can select as many as you want anytime you want. Test it now. You can reduce the visual distraction by doing this https://forums.autodesk.com/t5/autocad-forum/selection-limit/m-p/5521043#M73662 (yes, set it to 0 to have no limit).

 

But as noted by others, there are way better ways to do what you want, LAYMRG command may be the best https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-7D66940F-EC67-4DEC-89BC-82B887EABD6E 

Message 7 of 11

Kent1Cooper
Consultant
Consultant

@doben wrote:

You can do it with the "change" command.  ....


... or with CHPROP, which condenses the CHANGE commmand and its Properties option into one command name, so you can go directly to which property you want to change.

Kent Cooper, AIA
0 Likes
Message 8 of 11

paullimapa
Mentor
Mentor
Accepted solution

Here is one way to do a Layer Merge:

1. Make sure all Layers are unlocked by entering this code at the Command line:

(vl-cmdf "_.Layer" "_Unl" "*" "")

2. Open Layer Properties Manager by entering command: Layer 

3. Select any Layer name and use keyboard combination Ctrl+A to select all layers

4. Deselect a Target Layer like Layer 0 by holding down the Ctrl key and Left mouse click on the Layer name

5. Hover over any of the selected Layers, right mouse click and on the cursor menu left mouse click on "Merge selected layer(s) to"

6. When the Merge to Layer window appears with the only Target layer (like Layer 0) selected click OK

7. When 2nd Merge to Layer window appears with question to continue click Yes

AutoCAD will then automatically place all objects onto the Target Layer in this case Layer 0 and delete all the other Layers.

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 9 of 11

Yuan_LiuTUF66
Observer
Observer
It's a complex dwg containing all the elements you mentioned. the purpose is to "flatten" it then use it as background for a new dwg.
0 Likes
Message 10 of 11

Yuan_LiuTUF66
Observer
Observer
Thanks for the tip! I tried change comment but no idea why it didn't work...I tried with merge layer it works finally.
0 Likes
Message 11 of 11

RSomppi
Mentor
Mentor

You're welcome...

0 Likes