+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    3

    Default Tool/Lisp to find certain instances of a block or polyline and print to pdf

    Registered forum members do not see this ad.

    Hi All.

    I was wondering if anyone knows of a tool or a way to basically, batch PDF multiple viewports or specific coordinates within a paper layout. I have an A0 drawing where i need a print of the A0 drawing, and multiple grids set to A4 then a Jpeg showing the full plan with the grids on. I have set up a script using the -plot command and set the Coordinates for each grid. However it is a bit slow and cumbersome to do this on multiple drawings. Does anyone know of a way to maybe either through a script or a lisp, to open a drawing. Find certain instances of a block or polyline and print (with certain parameters like include an outline of 10mm around the edge of the grid) and when it has no more blocks to search for, it saves, closes and opens next drawing to search and print?

    Any help is very much appreciated.

    Thanks

  2. #2
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,786

    Default

    this can be changed for model or layout tabs and uses multiple block for location create a block sheet size on a no plot layer use array etc to create.

    Code:
    ; printing multiple sheets in model space automatically
    ; by Bigal 2011
    (PROMPT ".....PRINTING DRAWING TO plotter....")
    (setq oldsnap (getvar "osmode"))
    (setvar "osmode" 0)
     
    (setq ss2 (ssget "x" '((0 . "INSERT")(2 . "Your blockname here")(410 . "Model"))))
    (setq n (sslength ss2))
    (setq index 0)
    (repeat n
        (setq en (ssname ss2 index))
        (setq el (entget en))
        (setq inspt (assoc 10 el)) ; insertion pt
       (setq xmin (- (cadr inspt) 6.0))
       (setq ymin (- (caddr inspt) 6.0))
       (setq xymin (strcat (rtos xmin 2 1) "," (rtos ymin 2 1)))
       (setq xmax (+ xmin 813.0)) ; hard coded for 813 wide 6mm offset
       (setq ymax (+ ymin 566.0)) ;hard code for 566 high
       (setq xymax (strcat (rtos xmax 2 1) "," (rtos ymax 2 1)))
     
      (COMMAND "-PLOT"  "Y"     "" "Design-5100"
            "A3" "M"     "LANDSCAPE"   "N"
            "W"   xymin   xymax "1=2"  "C"
            "y"   "Designlaser.ctb"      "Y"   "" "n"   "n"
            "y" 
        )
     
      (setq index (+ index 1))
    )
    (setvar "osmode" oldsnap)
    (princ)
    A man who never made mistakes never made anything

  3. #3
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    3

    Default

    Ah great thanks. So with this am i able to open a drawing, it searchs for the block ive named, it will then print each one consecutively (to a filename i can suggest?) to A4? what do i need to change to make this work?

    ive only recently been trying out lisps and scripts etc so still new to all this.

    Thanks

  4. #4
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,786

    Default

    Tomorrow will paste pdf code link, you would need to do something like pdf name dwgname+view1 then dwgname+view2 if using layouts so much easier can use layout name+dwgname. You need to learn about scripts also very easy for this task.

    Wrong computer at moment building a new 1
    A man who never made mistakes never made anything

  5. #5
    Forum Newbie
    Using
    AutoCAD 2012
    Join Date
    May 2012
    Posts
    3

    Default

    Bigal... any change i could see the new code you were going to send please?

    Many Thanks

  6. #6
    Forum Deity
    Using
    Civil 3D 2013
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    3,786

    Default

    Registered forum members do not see this ad.

    Can you post a dwg please you have asked for different ways to do it grids views titleblock ?
    A man who never made mistakes never made anything

Similar Threads

  1. Block Find Lisp
    By jaylo23 in forum AutoLISP, Visual LISP & DCL
    Replies: 16
    Last Post: 23rd Aug 2012, 03:28 am
  2. Replies: 28
    Last Post: 27th Jul 2011, 07:19 am
  3. Tough Questions - Closed Polyline Tool (Shrinkwrap) Lisp
    By johnshar123xx in forum AutoCAD General
    Replies: 6
    Last Post: 4th Dec 2009, 03:06 pm
  4. Rename only selected instances of a block?
    By Ramosurf in forum AutoCAD General
    Replies: 4
    Last Post: 8th Jun 2007, 01:02 am
  5. find out the missing polyline thru lisp
    By vivekgrs in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 16th Sep 2006, 09:58 am

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts