Layouts to .DWG

Discussion in 'AutoCAD' started by whatlms, May 13, 2004.

  1. whatlms

    whatlms Guest

    If I have a .dwg file that contains multiple layouts is there a way to produce a separate .dwg file for each of the layouts? I know about the PLT2DWG converter but this is not what we need. Thanks, Mark.
     
    whatlms, May 13, 2004
    #1
  2. whatlms

    Paul Turvill Guest

    SAVEAS ... ?
    ___

    produce a separate .dwg file for each of the layouts? I know about the
    PLT2DWG converter but this is not what we need. Thanks, Mark.
     
    Paul Turvill, May 13, 2004
    #2
  3. whatlms

    BTO Guest

    no tested.

    Bruno Toniutti

    ;;;
    ;;; LayoutsToDwgs.lsp
    ;;; Created 2000-03-27

    ;;; By Jimmy Bergmark
    ;;; Copyright (C) 1997-2003 JTB World, All Rights Reserved
    ;;; Website: www.jtbworld.com / http://jtbworld.vze.com
    ;;; E-mail: /

    ;;; For AutoCAD 2000
    ;;;
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    ;;; Creates drawings of all layouts.
    ;;; Only one layout at a time is saved, the rest are deleted.
    ;;; This is handy when you want to save to pre A2k versions.
    ;;; The new drawings are saved to the current drawings path
    ;;; and overwrites existing drawings.
    ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    (defun c:LayoutsToDwgs (/ fn path msg msg2 fileprefix)
    (defun DelAllLayouts (Keeper / TabName)
    (vlax-for Layout
    (vla-get-Layouts
    (vla-get-activedocument (vlax-get-acad-object))
    )
    (if
    (and
    (/= (setq TabName (strcase (vla-get-name layout))) "MODEL")
    (/= TabName (strcase Keeper))
    )
    (vla-delete layout)
    )
    )
    )

    (vl-load-com)
    (setq msg "")
    (setq msg2 "")
    (command "._undo" "_BE")
    (setq fileprefix (getstring "Enter filename prefix: "))
    (foreach lay (layoutlist)
    (if (/= lay "Model")
    (progn
    (command "_.undo" "_M")
    (DelAllLayouts lay)
    (setvar "tilemode" 0)
    (setq path (getvar "DWGPREFIX"))
    (setq fn (strcat path fileprefix lay ".dwg"))
    (if (findfile fn)
    (progn
    (command ".-wblock" fn "_Y")
    (if (equal 1 (logand 1 (getvar "cmdactive")))
    (progn
    (setq msg (strcat msg "\n" fn))
    (command "*")
    )
    (setq msg2 (strcat msg2 "\n" fn))
    )
    )
    (progn
    (command ".-wblock" fn "*")
    (setq msg (strcat msg "\n" fn))
    )
    )
    (command "_.undo" "_B")
    )
    )
    )
    (if (/= msg "")
    (progn
    (prompt "\nFollowing drawings were created:")
    (prompt msg)
    )
    )
    (if (/= msg2 "")
    (progn
    (prompt "\nFollowing drawings were NOT created:")
    (prompt msg2)
    )
    )
    (command "._undo" "_E")
    (textscr)
    (princ)
    )
     
    BTO, May 25, 2004
    #3
  4. Jimmy Bergmark, May 26, 2004
    #4
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.