×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

converting individual layer to dwg file

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 :)

RE: converting individual layer to dwg file

I'm not sure I follow your question.
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

Thanks for your good explanaion to my question.

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

FILE: EXPORT allows you to choose, by way of selection, any objects you want to make a seperate file.

RE: converting individual layer to dwg file

(OP)
What I ment is how to wblock out each individual layer as I have many layers. How to write a script file to do that ?

RE: converting individual layer to dwg file

Jimad,

What version of AutoCAD are you on?

RE: converting individual layer to dwg file

I apologize, but I find it a little hard to follow your question. If you are looking to create a file with the current layers you are using into another file, you can save your drawing as a dwt (template) and use it to begin a new drawing and have your layers already setup. If you want to export a list of the layers you have into a text file, you can use the following LISP routine.

(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

(OP)

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

Dear Jimad,
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

Unless you have third-party software LT does not support autolisp.

RE: converting individual layer to dwg file

Do you want something like this, but in a cycling macro for each layer.

(command "_.saveas" "2000" (getvar "clayer"))

RE: converting individual layer to dwg file

hi,
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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources