Elektrik Posted October 16, 2022 Share Posted October 16, 2022 I want to convert all drawing to the current layer used, then set all drawing by layer, then purge it, then -purge regapps (without verifying each name to be purged), and finally laydel (delete all layers other than the current one). Thanks in advance. Quote Link to comment Share on other sites More sharing options...
mhupp Posted October 16, 2022 Share Posted October 16, 2022 Give this a try ;;----------------------------------------------------------------------------;; ;; Condence Drawing to one layer (defun C:OOF (/ SS) (setq SS (ssget "_X" '((410 . "Model")))) ;select everything in model space ;change selection set SS to current layer and color to bylayer (vl-cmdf "_Chprop" SS "" "LA" (getvar 'clayer) "C" "Bylayer" "") (repeat 3 (vl-cmdf "_.Purge" "A" "*" "N")) ;purge 3 times (princ) ) 3 Quote Link to comment Share on other sites More sharing options...
Steven P Posted October 16, 2022 Share Posted October 16, 2022 Beaten to it by MHUPP... but you have done all the hard work by writing out the process you want to follow - an internet search would give you all the components of what you want to do and then all you need is to put it all together. OK might not be as pretty as above, but it should work out. Might want to add something like this https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/change-all-to-0-layer-by-layer-including-block-and-block-in/td-p/5376995 to set all block contents to layer 0, with options from KentClark and Lee Mac - I tend to favour Lees code through experience it works well. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.