Export layout to model AutoCAD LISP
© Corel Corporation. All rights reserved. The content herein is in the form of a personal web log ("Blog") or forum posting. As such, the views expressed in this site are those of the participants and do not necessarily reflect the views of Corel Corporation, or its affiliates and their respective officers, directors, employees and agents. Terms of Use / Privacy / Cookies / Terms and Conditions / User Guidelines. We have a few clients that on occasion will need separate drawings for each layout we have in our drawings. It's time consuming to File>Save As for each drawing needed and then go in each new drawing and delete the unnecessary layout tabs. There are LISP routines out there that do just what we need. Could functionality be added to Land/FX to address this? Thanks! (LISP example - http://jtbworld.com/autocad-export-layouts-to-drawings-layoutstodwgs-lsp) Jon, That is something that is already on our radar, as it is something we need in the drawing cleanup process. This is
definitely an interesting and novel solution. I would rewrite it using Export instead of WBlock, and it currently is not compatible with non-English installations. Oh, and it does need some more careful error handling through the operation (it's not confirming that the save was successful). --J Heya, I find that 'export layout to model' just doesn't work. My work around is thus; Publish the wanted layout to a .pdf, either the entire set of layouts/drawings or as a single one. Open a new drawing and use 'pdfimport' command & right click Navigate to said pdf. Select sheet/layout in question. ok wait.......blue bar at bottom right can move slowly. Then modify drawing as required - check any scaling issues that may arise. nuke. purge etc. save as. Would love a function for this purpose. Cheers Jobe Joby, That's interesting. Another user also brought to our attention the incredible Lee Mac tool, Steal: http://www.lee-mac.com/steal.html It is still on our radar to address this, but has certainly been deprioritized due to it being such a seldom needed task. --J Thanks Captain J I may give that a trial next time i've the need for 'stealing' a layout. :) Hi Jon, There's the "Save Layout as Drawing" command under "Save As" (or_exportlayout) already built into AutoCAD that does what you're describing. I've used it a could of times and it works great. Tim
There are no replies made for
this post yet. Since AutoCAD 2009, we have had the ability to export a single layout to a new model space drawing. (CAD Tip No. 3100 is all about this process.) This routine by Amir Hossein Sattarian allows you to export multiple layouts to individual DWG files automatically. After you load the LISP file, run the command LXA and the LISP code will do the rest. Each layout will be exported to a separate DWG file. The DWG files will be located in a new subfolder of the current drawing's folder named "Layouts." The LISP code actually writes a script file, then loops the calls to the built-in ExportLayout command. Often I need to create a useable DWG file for customers. The problem is we use xrefs for our drawings, so a file save as doesn’t work because the source file is still linked and can’t be exploded. However, by using the Export Layout to Model command, it just takes a few steps to create a useable DWG for my customer.
I don’t know when this feature came out, but it sure has helped a lot. A big improvement on what was once a time-consuming process using a finicky AutoLISP routine and often ending up basically redrawing the print. Notes from Cadalyst tip reviewer R.K. McSwain: This is more or less a repeat of Tip #3100, but Jeanie's tip here emphasizes that external references are bound to the main drawing during this process. This is an important feature of this process that should not be overlooked. About the same thing we do. (command "TILEMODE" 1) ;====================================================================== Delete Page Setups & Set Plot Style to KTA.ctb ;====================================================================== (prompt "\n Detach All Image References.....") ;====================================================================== (princ "\n Standard KTA drawing variables initiated!!") ;====================================================================== Layer setups for backgrounds ;====================================================================== (prompt "\n BINDTYPE set to Insert for all XREF's!") (autoload "XRBIND" '("XRBIND")) ;====================================================================== (prompt "\n Set Layer 0 as current Layer.") ;====================================================================== ;====================================================================== (autoload "mkbylayer" '("mkbylayer")) ;====================================================================== ;====================================================================== Layer setups for backgrounds (autoload "MAKE8" '("MAKE8")) (command "_.layer" "c" "7" "DEFPOINTS" "") (autoload "hatch29" '("hatch29")) (autoload "LRD" '("LRD")) ;(autoload "19" '("19")) ;====================================================================== ;====================================================================== (setq a 0) (setq a 0) ) ;(prompt "\n Normal Detach of all XREF's not found!") ;(prompt "\n Selecting ALL Object's!") ;(prompt "\n Exploding New Blocks of these XREF Object's!") ;====================================================================== ;====================================================================== ;============================================== begin file name structure (setq myFile (getvar "DWGNAME")) (princ "\n Stripped File Name : ") (princ "\n File Prefix :") (princ "\n File Extension :") (setq newName (strcat newPrefix strippedFile newExtension)) (setq newFile (strcat myPath newName)) (princ "\n continue to Export.....\n") (alert " ;========================================== Begin Export Function (defun myExport07() (defun myExport08() (defun myExport() ; ACADVER = "17.1s (LMS Tech)" ;============================== AutoCAD MEP 2009 ================================= ;============================== AutoCAD MEP Acad 2010 ================================= ;============================== AutoCAD MEP 2010 ================================= ;=================================== Undo & save to leave original file as found (princ "\n Begin to return file to original state :\n") (defun OpenFile () (OpenFile) (princ "\n File open successful!!") |