Jump to content

Recommended Posts

Posted

Has any one a method of making a index sheet of all the layouts I intend to plot a A1 sheet with somewhere around 100 dwgs on it they will appear like postage stamps.

 

I have a couple of ideas but thought I would ask first.

Posted

This sounds like a cool idea. I don't think that there is a way to do it in AutoCAD. I assume that you's have to plot the whole drawing set to an image file format, and then use Windows to do an index print.

 

Let us know how you get on!

Posted

I used to create an index of drawings into a PDF,to make it easier to find the correct drawing. You can insert all the pages of a PDF into a drawing as well, and scale them as you need. may be a LISP could automate it, I'm LT so just throwing out the idea, but I just tested placing all the pages from a PDF into a drawing (manually) and it works.

Posted

I think I will resort to plotting either jpgs or pdfs then just reimport into an external dwg, I have a auto pdf out all layouts so maybe I will use that 1st.

Posted

Version 1 using pdfs I made a txt file of the pdf names including directory then just converted to a script its not quite right does 1 line and its just not obvious will go get coffee and try again. use start DIR *.pdf > dirpdf.txt /b to make list then used word to add directory name.

 

; make a index sheet using pdf's
; first use CMD dir *.pdf >pdf.txt /b
; remove unwanted pdfs from list
; by Alan H Jan 2014 
(defun AH:stampindex ( / x y fopen fout new_line)
(setq x 0)
(setq y 0)
(setq fopen (open "C:/acadtemp/dirpdf.txt" "R"))
(setq fout (open "C:/acadtemp/dirpdf.scr" "W"))
(repeat 10
(repeat 10
(princ x)
(while (setq new_line (read-line fopen))
(write-line "-pdfattach" fout)
(write-line (strcat (chr 34) new_line (chr 34)) fout) 
(write-line "1" fout)
(write-line (strcat (rtos x 2 0) "," (rtos y 2 0)) fout)
(write-line "0.25" fout)
(write-line "0" fout)
(setq x (+ x 250))
) ; while
) ; 2nd repeat
(setq x 0)
(setq y (+ Y 170))
) ; 1st repeat
(close fopen)
(close fout)
) ;defun
(AH:stampindex)
(princ)

Posted

If you want to pay for a solution, Dotsoft Toolpac has that built-in. (not affiliated)

Posted (edited)

Version 2, now done will go the JPG way the PDf's do some funny things when you have lots of them.

 

; make a index sheet using jpg's
; first use CMD dir *.pdf >pdf.txt /b
; remove unwanted jpgs from list
; by Alan H Jan 2014 

(vl-load-com)
(defun AH:stampindex ( / x y fopen fout new_line)
(setvar "osmode" 0)
(setq x 0)
(setq y 0)
(setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
(setq fopen (open "C:/acadtemp/dirjpg.txt" "R"))
(repeat 10
(repeat 10
(princ x)
(if (/= (setq newline (read-line fopen)) nil)
(progn
(vla-AddRaster mspace newline (vlax-3d-point(list x y)) 1.5 0.0)
;(command "-imageattach" newline (list x y) 0.25 0)
(setq x (+ x 2.5))
) ; if
) ; progn
) ; 2nd repeat
(setq x 0.0)
(setq y (+ Y 1.7))
) ; 1st repeat
(close fopen)
) ;defun
(AH:stampindex)
(princ)

 

Jpg generator

; plotpdf2 ver 2 with filename and directory as output oct 2011
(PROMPT ".....PRINTING DRAWING TO pdf's....")
(setvar "cmddia" 0)
(setvar "filedia" 0)
(setq plotabs nil) ; in case run before
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layouts doc)
 (setq plotabs (cons (vla-get-name lay) plotabs))
)
(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)
(setvar "textfill" 1)
    
     (COMMAND "-PLOT"  "Y"  "" "PublishtoWeb JPG"
       "VGA (640.00 x 480.00 Pixels)" "LANDSCAPE"  "N"   "W"  "-6,-6"    "807,560" "f"  "C"
       "y"   "Designlasercolour.ctb" "Y" "n"    "n"    "n"   pdfName "N" "y"      )
   )
 )
 (setq x (+ x 1))
)
(setvar "cmddia" 1)
(setvar "filedia" 1)
(setq DWGNAME nil
     LEN nil
     NAME nil
     PLOTTABLIST nil) 
(princ)

Edited by BIGAL
Updated version
  • 2 weeks later...
Posted

A bit more almost there having problems once a image has spaces in its name, added title under images.

 

C:/ACADTEMP/EXCEL.JPG

C:/ACADTEMP/EXTRUDEPATH.JPG

p:/2010026/DESIGN/2010206 Jan 2014-D01.jpg

 

First two work fine once it gets to 3rd error about can not open file. Tried variations on the two methods with and without quotes "...", anybody any ideas ?

 

(vla-AddRaster mspace (strcat (chr 34) newline (chr 34)) (vlax-3d-point (list x y)) 1.5 0.0)
;(command "_imageattach" newline (list x y) 0.5 0)

Posted

Working version now

 

; make a index sheet using JPGS
; first use PLOTJPGS or CMD dir *.JPG >DIRJPG.txt /b
; remove unwanted JPGS from list
; by Alan H Jan 2014 
(vl-load-com)
(defun AH:stampindex ( / x y fopen newline)
(setvar "osmode" 0)
(setvar "limmin" (list -1 -1))
(setvar "limmax" (list 24 16))
;(command "zoom" "A")
(command "zoom" "C" (list 12.5 8.5) 20.0)
(setvar "Textstyle" "Standard") ; set style to standard no annotation or height
(setvar "ctab" "Model")
(setq x 0.0)
(setq y 0.0)
(setq mspace (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))))
(setq fopen (open "C:/acadtemp/dirjpg.txt" "R"))
(repeat 10
(repeat 10
(if (/= (setq newline (read-line fopen)) nil)
(progn
(princ NEWLINE)
(command "_.-image" "_A" newline (list x y) 1.0 -90) ; scale factor 1.0 rotation 90 deg
(setq tpt (polar (polar (list x y) 4.7123 0.25) 3.1417 1.3)) ; offset for text
(command "text" tpt 0.05 90.0 newline ) 
(setq x (+ x 2.5))
) ; if
) ; progn
) ; 2nd repeat
(setq x 0.0)
(setq y (+ Y 1.7))
) ; 1st repeat
(close fopen)
) ;defun
(AH:stampindex)
(princ)

 

; plotjpg ver 2 with filename and directory as output Jan 2014
(defun AH:PLOTJPGS ( / fout plotabs len x name dwgname LEN PLOTTABLIST)
(PROMPT ".....PRINTING DRAWING TO JPg's....")
(setvar "cmddia" 0)
(setvar "filedia" 0)
(setq plotabs nil) ; in case run before
(setq fout (open "C:/acadtemp/dirjpg.txt" "W"))
(setq dirname (getvar "dwgpath"))
(setq doc (vla-get-activedocument (vlax-get-acad-object)))
(vlax-for lay (vla-get-Layouts doc)
 (setq plotabs (cons (vla-get-name lay) plotabs)) ; collection of layout tabs
)
(setq plotabs (vl-remove "Model" plotabs)) ; remove model from list
(setq plotabs (vl-remove "PlotPreview" plotabs)) 

(setq dwgname (GETVAR "dwgname")) ; current dwg name
(setq len (strlen dwgname))
(setq dwgname (substr dwgname 1 (- len 4)))
(setq plottablist (acad_strlsort plotabs)) ; sort layouts
(setq len (length plottablist))
(setq x 0)
(repeat len
 (setq name (nth x plottablist))
 
(setq jpgname (strcat (getvar "dwgprefix") dwgname "-" name ".jpg"))
 (if (/= name "Model")
   (progn
     (setvar "ctab" name)
     (setvar "textfill" 1)
; change plotter pen settings designlasercolour for thicker lines     
     (COMMAND "-PLOT"  "Y"  "" "PublishtoWeb JPG"
       "A4 400dpi" "LANDSCAPE"  "N"   "W"  "-6,-6"    "807,560" "f"  "C"
       "y"   "Designlasercolour.ctb" "Y" "n"    "n"    "n"   jpgName "N" "y"      )
     (write-line jpgname fout)
     (princ jpgname)      
   ) ; progn
     
  ) ; if
 (setq x (+ x 1))
) ; end if
(close fout)
(setvar "cmddia" 1)
(setvar "filedia" 1)

)
(AH:plotjpgs)
(princ)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...