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
Solved! Go to Solution.
Solved by braudpat. Go to Solution.
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)
Or you can use Purge command to delete unused layers in dwg file.please find attached image.
I think this will help you because after entering command user can select appropriate option and no need to enter name of each layer.
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
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.
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
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 BRAUD
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.
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
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.
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.