converting individual layer to dwg file
converting individual layer to dwg file
(OP)
Hi does anyone know how to convert all layers
into a individual drawing files automatically ??
Thanks :)
into a individual drawing files automatically ??
Thanks :)





RE: converting individual layer to dwg file
But...
If you have the express tools in ACAD2000, you can type "LMAN" for the layer manager. This should allow you to export the layers into a "LAY" file, not "DWG".
And if that suits your needs, you may want to write a script to do multiple files.
hope that helps.
R
RE: converting individual layer to dwg file
Frankly, I am trying to learn AutoCad 2D & 3D from now on.
Could you please recommend me how I can learn AutoCad effectively?
I am really interested in piping design for refinery plant using PDS but I am just wondering if this PDS shold be operated based on Microstation not AutoCad 3D or AutoCad Solid Works.
Thanks
RE: converting individual layer to dwg file
RE: converting individual layer to dwg file
RE: converting individual layer to dwg file
What version of AutoCAD are you on?
RE: converting individual layer to dwg file
(defun WRITELYRS ()
(setq TXTFILE (open "C:\\LAYERS.txt" "W")
TDATA NIL
CNT 0
)
(while (setq TDATA (tblnext "LAYER" (not TDATA)))
(setq CNT (1+ CNT))
(write-line (cdr (assoc 2 TDATA)) TXTFILE)
)
(close TXTFILE)
)
RE: converting individual layer to dwg file
I am using Acad 2002LT
If I have layer :
0
AA
BB
CC
After running the Scrip file ,
I should get
AA.dwg
BB.dwg
CC.dwg
RE: converting individual layer to dwg file
Loading the following autolisp code, will add a command SBL to your drawing session. The SBL command does your mentioned job.
All DWGs will save in the root of drive C: .
If some drawings with the same name there exist in the root of drive c:, the program will not work properly. So before running the SBL command, be sure there is no DWG with the name similar to layer names in c:\ .
(defun c:SBL(/ llist lname)
(setvar "cmdecho" 0)
(setq llist (tblnext "layer" t))
(while (not (null llist))
(setq lname (cdr (assoc 2 llist)))
(setq lss (ssget "x" (list (cons 8 lname))))
(command "wblock" (strcat "c:\\" lname) "" '(0 0) lss "")
(command "oops")
(setq llist (tblnext "layer"))
)
(prompt "\n All objects extracted by layer.\n")
(princ)
)
:)
Farzad
RE: converting individual layer to dwg file
RE: converting individual layer to dwg file
(command "_.saveas" "2000" (getvar "clayer"))
RE: converting individual layer to dwg file
The SBL code above is just what I required, but I would be much better if I could specifiy where the dwg's are saved, such as a dialog box where I can then select the required path.