Jump to content

Search the Community

Showing results for tags 'active layout'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • CADTutor
    • News, Announcements & FAQ
    • Feedback
  • AutoCAD
    • AutoCAD Beginners' Area
    • AutoCAD 2D Drafting, Object Properties & Interface
    • AutoCAD Drawing Management & Output
    • AutoCAD 3D Modelling & Rendering
    • AutoCAD Vertical Products
    • AutoCAD LT
    • CAD Management
    • AutoCAD Bugs, Error Messages & Quirks
    • AutoCAD General
    • AutoCAD Blogs
  • AutoCAD Customization
    • The CUI, Hatches, Linetypes, Scripts & Macros
    • AutoLISP, Visual LISP & DCL
    • .NET, ObjectARX & VBA
    • Application Beta Testing
    • Application Archive
  • Other Autodesk Products
    • Autodesk 3ds Max
    • Autodesk Revit
    • Autodesk Inventor
    • Autodesk Software General
  • Other CAD Products
    • BricsCAD
    • SketchUp
    • Rhino
    • SolidWorks
    • MicroStation
    • Design Software
    • Catch All
  • Resources
    • Tutorials & Tips'n'Tricks
    • AutoCAD Museum
    • Blocks, Images, Models & Materials
    • Useful Links
  • Community
    • Introduce Yourself
    • Showcase
    • Work In Progress
    • Jobs & Training
    • Chat
    • Competitions

Categories

  • Programs and Scripts
  • 2D AutoCAD Blocks
  • 3D AutoCAD Blocks
  • Images
    • Backgrounds

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Found 1 result

  1. Hi all! I'm new to LISP--just started teaching myself yesterday--so I might have missed something obvious, but... I'm trying to write a routine that prints a PDF of a drawing to the same directory as the drawing itself, and that only prints the current layout sheet. The first half of that I have, thanks to the code examples posted by BIGAL and woodman78 here: http://www.cadtutor.net/forum/showthread.php?69132-Printing-LISP-Help... The second half--getting it to only print the current layout--is where I'm having trouble. Plotting every layout from the drawing is useful in some cases, but generally I just want the one I have selected at the time. This is what I'm using: (defun c:pdf () (setvar "cmddia" 0) (setvar "filedia" 0) (setq doc (vla-get-ActiveDocument (vlax-get-acad-object))) (vlax-for lay (vla-get-Layouts doc) (setq plottabs (cons (vla-get-name lay) plottabs)) ) (setq dwgname (getvar "dwgname")) (setq len (strlen dwgname)) (setq dwgname (substr dwgname 1 (- len 4))) (setq plottablist (acad_strlsort plotabs)) (setq len (length plottablist)) (setq x 0) (repeat len (setq name (nth x plottablist)) (princ name) (setq pdfname (strcat (getvar "dwgprefix") dwgname "-" name)) (if (/= name "Model") (progn (setvar "ctab" name) (command "-plot" "yes" "" "dwg to PDF" "ANSI full bleed B (11.00 x 17.00 Inches)" "inches" "landscape" "no" "extents" "fit" "center" "yes" "monochrome.ctb" "yes" "no" "no" "no" pdfName "n" "y" ) ) ) (setq x (+ x 1)) ) (setvar "cmddia" 1) (setvar "filedia" 1) (setq DWGNAME nil LEN nil NAME nil PLOTTABLIST nil) (princ) ) I've narrowed the issue down to the section here: (vlax-for lay (vla-get-Layouts doc) (setq plottabs (cons (vla-get-name lay) plottabs)) ) What would I use instead of vlax-for to get the name of just the current layout? Thanks
×
×
  • Create New...