Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

AutoCAD file clean up task, need to remove all the layers except 4 layers.

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
Anonymous
3361 Views, 10 Replies

AutoCAD file clean up task, need to remove all the layers except 4 layers.

hi

 

I am very new to AutoCAD, I am facing a challange and i need to seek guidance. Not sure if similar post is already available.

 

I have 1000 plus DWG files and i want to process each file, I have to delete all the layers example - Title, Anno, Extra layers, Except the 4 layers (names are fixed for these layers).

 

Is there a way to only keep 4 layers and remove the rest of the layer. I am looking forward to use a lisp routine which serves my purpose and doesnot ask user to input the names.

 

As i am quiet new to autocad hence not aware it. Appreciate if any one can guid me.

 

Thanks

 

10 REPLIES 10
Message 2 of 11
Anonymous
in reply to: Anonymous

I think you can use Etransmit command to delete all unused layer in all selected drawings.please see attached image.(it may delete unused blocks also)

 

ETRANSMIT.png

 

 

Or you can use Purge command to delete unused layers in dwg file.please find attached image.

 

 PURGE.png

 

I think this will help you because after entering command user can select appropriate option and no need to enter name of each layer.

Message 3 of 11
Anonymous
in reply to: Anonymous

Hi,

 

Ok with cleaning portion but stuck here--

 

I m facing a small challange here after cleaning my layers there are some small portion of legends still appearing (left over) on the top of my drawing.

 

The reason these legends are available cause they are the part of the layer i do not wish to delete. However I dont want these legends

 

I just want to delete these small left over legends which lay atop on the empty space.

 

I have to manually select them and delete them, for better understanding i am attaching an image of these pieces. - leftOverLegends.png ( i dont want)

 

I am also attaching how my DWG looks after cleaning - CleanButLegendsRemaining.dwg

 

Any help will be appreciated

 

Thanks

Message 4 of 11
Anonymous
in reply to: Anonymous

I'm glad to help you.

I saw dwg file , you have to select unwanted objects manually to delete them. Because they are just objects.

Please accept this as solution if you think it is helpfull to you.

Message 5 of 11
Anonymous
in reply to: Anonymous

Hi

 

I have 2000 plus files i cant open each one of them and select it manually, I have to write a command which can clean that region. Any suggestion in writing a command to clean a region ?

 

Thanks

Message 6 of 11
braudpat
in reply to: Anonymous

 

Hello

 

Suggestion :

 

1 - Please draw a rectangle which "captures" the region !

2 - Select the rectangle then LIST so you get the 4 XY coordinates and remind two of them : right top & left bottom

 

So you can erase the rectangle ... and you can type on your keyboard something like :

ERASE <Enter>

C <Enter>

4000,1000 <Enter>

-500,-500 <Enter>

<Enter>

 

So you have erased the region ... You have the Script file to run for each drawing !

 

Or write a ONE line Lisp instruction which does the same job ...

(command "_erase" "_c" "4000,1000" "-500,-500" "")

 

Of course I imagine that all layers are unlocked !

 

Do you see that I mean !?

 

 

Patrice ( Supporting Troops ) - Autodesk Expert Elite
If you are happy with my answer please mark "Accept as Solution" and if very happy please give me a Kudos (Felicitations) - Thanks

Patrice BRAUD

EESignature


Message 7 of 11
Anonymous
in reply to: Anonymous

If all dwg files contain same drawings situated at same cordinates on workspace then we can use following script:

please write down following programm on notepad and save it as .scr file.

 

erase

cordinates of right bottom corner for crossing window(this you will get by command ID)

cordinates of left upper corner for crossing window

 

 //double enter here after writing script

 

save above script and enter scr in command line select script to open, so that it will erase those unwanted object. please see attached notepad and your dwg.

try to run given script in your dwg , it will erase those part of which cordinates are entered in script. By using same logic you can erase other objects.

Note: You can repeat same command but with different cordinates in same script.

If you will run given script in currently attached your drawing it will erase objects which are shown by enclosed rectangle.

image.png

Message 8 of 11
Anonymous
in reply to: Anonymous

please find attached script

Message 9 of 11
Anonymous
in reply to: Anonymous

hi thanks for the replies,

 

I am still checking if there a way to check if "this Layer" exist in the current drawing and then proceed to delete it. ?

 

while i was running my lisp file i face across multiple DWG which may or may not have some of the layers.

 

Can someone help to suggest a valid IF syntax?

 

for example i have a layer "Fence". then how do i check if (Fence exist in this DWD) do something else do something else.

 

Thanks

 

 

Message 10 of 11
jggerth
in reply to: Anonymous

Looks like you're missing the fundamental problem of qa/qc.  It seems that you are not that familiar with the contents of the drawings, nor how they were created.  If that's the case, it's difficult to understand how you expect to get anything of value out of automated processes.  It would seem that a visual inspection of the drawings as part of a manual cleanup is something you are avoiding, but need.

Message 11 of 11
Anonymous
in reply to: jggerth

hi JGerth,

 

These files are 10 yrs old, and the QA QC was done way back, today there is a need to create a topo data with some modification hence we are using all old files. But seems visual check is needed.

Thanks.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost