Jump to content

Auto print to pdf lisp


Fusik

Recommended Posts

Hello everyone.

I am tired to write my projects to pdf. Can i ask you to write for me lisp which let me do it faster?

In a layout i have prepared my sheet dimentions with frame (5mm on each side) and got vport inside with my drawing in scale.

I want to use lisp which:

1. after command the program ask me about print window

2. after marking the rectangle (ex. 297x540) the lisp create the new paper format with dimensions (297x540)

3.the prineter DWG to PDF will be choose

4. the file name can be ask to wite or autonamed (projectname.dwg and time or number. ex( xxx.dwg 13-06-2017-22;30.pdf or xxx.dwg 1.pdf

5 the printed pdf will be saved to the dwg location.

 

I hope i clearly described my idea. Thanks a lot for everyone reading and helpers :)

Link to comment
Share on other sites

  • Replies 21
  • Created
  • Last Reply

Top Posters In This Topic

  • Fusik

    7

  • BIGAL

    6

  • maratovich

    4

  • 8908103

    2

Top Posters In This Topic

Posted Images

There are numerous examples of code posted here I know I posted my latest version recently so search BIGAL and Plotting. Th version I posted should meet your needs or can be modified to suit your exact requirements.

Link to comment
Share on other sites

I don't think you need any lisp

You need to make sure you have set up your "page Setup" as you want to plot

Then in "option", on "plot and Publish" tab, tick "Automatic Publish" and you can specify what format you want (DWF or PDF), when to plot ( save or close), where to save.......

plot.jpg

Link to comment
Share on other sites

i got some drawings in a model

i have prepared in layout1 my papers size rectangle and scaled drawings

now i want to plot to pdf this all frames by lisp.

its should works that i only mark the rectangle and lisp auto make new paper size, named the pdf( can be auto projectname+date or ask by lisp to named the pdf) and save in file location:)

 

i hope i write it clearly :)

example2.dwg

Link to comment
Share on other sites

Here is an example two files the plota3dfrange2.lsp is the main one it will auto call the getvals.lsp this is set up for one sheet size.

 

Your post is the same as the other post, random sheet sizes, you need some form of rules to automate the process the mview outline would be better as a block with known sheet size preset just create multiple layouts for the desirable sheet size with a title block and copy that layout for each sheet. One mview for each layout.

 

Your layout has 7 different sheet sizes.

GETVALS3.zip

Link to comment
Share on other sites

I fully agree with BIGAL

 

Fusik -

I asked for an example of a real drawing. And you gave us a lot of rubbish.

Do you want to torture us?:x

Organize your drawings. Create real-size frames. For example A3 = 420x297 and others.

 

BIGAL-

Which team to run the LISP?

Link to comment
Share on other sites

@maratovich, @BIGAL very sorry for that, i hoped that examples of frames will be enough. The point is that most of my drawings has extra sizes A3 (297 height) but 560mm of lenght, A2 height (410) but 800mm of lenght.

The way I print it now it's:

1. crt+p

2 choose dwg to pdf

3 creating paper size

4 choosing created paper size

5 marking the print window (paper size)

6 save to pdf

and all over again what is frustrating.

I just wanna lisp which will be printing by marking rectangle ( the paper size frame)

This is example of my project ( 4-5 drawings in layout) but my real projects has 40-70 drawings and got more then 1 MB

Thanks for all helps and ideas :)

And sorry for a trouble:(

eXAPl1.dwg

Link to comment
Share on other sites

i saw you comment, but the paper size isnt creating auto. I must define it manual :

Ty for answer BIGAL :)

 

You should listen to BIGAL. You're plotting the awkward way possible and want help automating something that must be done manually. If you plot using layout it's automatically sized to the plotting limits of the paper size defined by the selected plotter. Tutorial worth taking a look at: http://www.cad-notes.com/using-autocad-page-setup/ Simply create Page Setups and layouts for each plot size.

 

When you're ready to start using the Sheet Set Manager the only way to have options PDF, DWF, DWFx, Plotter and others is having the Page Setups set to layout.

 

Done correctly plotting should be the simplest thing in AutoCAD.

Link to comment
Share on other sites

Here is how I would do it, check the drawing, note they are all at 0,0 now. I have included GOTO it allows you to jump to different layouts easily something missing in autocad. I have a project with 88 layouts 25Mb etc and I can plot 1, 3-10 or all as required using the lisp posted.

 

Again you need some way of determining what is the sheet size you could use the layout extents (getvar 'extmax) (getvar 'extmin) to work out sheet size and plot automatically.

 

I am a bit puzzled A1=841x594 A2=594x420 A3=420x297 A4=297x210 your sizes are not these.

 

; GOTO layout just like other goto a page
; By Alan H 2013
; menu command [GOTO]^c^C^p(load "goto")
; enter a big number like 99 to jump to last if 100+ layouts then 123 etc
; Model space is 0 zero GOTO 0

(defun C:goto ( / x alllayouts laynum num)

(setq num (getint "\nEnter tab number"))
(setq alllayouts (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
(SETQ LAYNUM 0)
(vlax-for x alllayouts
(Setq laynum (+ 1 laynum))
) ;total number of layouts

(if (> num laynum)
(setq num (- laynum 1))
)
(vlax-for lay alllayouts
(if (= num (vla-get-taborder lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
) ; for
) ; defun 

; I often type it wrong so added this one also
(defun C:goot ()
(c:goto)
) ; defun

eXAPl1 (2).dwg

Link to comment
Share on other sites

I just want to Print my layout drawings by marking the rectangles and auto print to pdf

its example of drawing

the prepared drawing are in layouts

http://www33.zippyshare.com/v/mMV1hmZB/file.html big file >15MB

thanks for the interest of subject :)

Fusik

This example is very good.

Printing is not a problem.

You can use a special program.

She find many blueprints in one tab.

Automatically determine the format and print.

Write your mail to me.

I will help you.

Edited by maratovich
Link to comment
Share on other sites

Thanks BIGAL, maratovich, tombu for precious clues. I have to change my way of prepering drawing into 1 drawing in 1 layout :) It not problem for me. BIGAL your lisp is preety good for standard paper sizes :)

I will be printing by KDMSoft application REVERS but it must be translated....

maratovich here is my e-mail address

wojciechfus@gmail.com
i dont know how to write to you through this forum :

Thanks a lot everyone, you are very helpfull :) I own you something :)

Link to comment
Share on other sites

  • 4 years later...

Hi everyone
I have a lot of maps in AutoCAD model space and it is very difficult to print them one by one.
Does anyone have a LISP file that I can quickly print maps together in AutoCAD? (Similar to this video (https://www.aparat.com/v/GRFpO/), but unfortunately the LISP file attached to this video does not work properly)

Link to comment
Share on other sites

On 6/18/2017 at 6:30 PM, maratovich said:

Fusik

This example is very good.

Printing is not a problem.

You can use a special program.

She find many blueprints in one tab.

Automatically determine the format and print.

Write your mail to me.

I will help you.

Hi

 

On 6/18/2017 at 4:38 AM, BIGAL said:

Here is how I would do it, check the drawing, note they are all at 0,0 now. I have included GOTO it allows you to jump to different layouts easily something missing in autocad. I have a project with 88 layouts 25Mb etc and I can plot 1, 3-10 or all as required using the lisp posted.

 

Again you need some way of determining what is the sheet size you could use the layout extents (getvar 'extmax) (getvar 'extmin) to work out sheet size and plot automatically.

 

I am a bit puzzled A1=841x594 A2=594x420 A3=420x297 A4=297x210 your sizes are not these.

 

 


; GOTO layout just like other goto a page
; By Alan H 2013
; menu command [GOTO]^c^C^p(load "goto")
; enter a big number like 99 to jump to last if 100+ layouts then 123 etc
; Model space is 0 zero GOTO 0

(defun C:goto ( / x alllayouts laynum num)

(setq num (getint "\nEnter tab number"))
(setq alllayouts (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
(SETQ LAYNUM 0)
(vlax-for x alllayouts
(Setq laynum (+ 1 laynum))
) ;total number of layouts

(if (> num laynum)
(setq num (- laynum 1))
)
(vlax-for lay alllayouts
(if (= num (vla-get-taborder lay))
 (setvar "ctab" (vla-get-name lay))
) ; if
) ; for
) ; defun 

; I often type it wrong so added this one also
(defun C:goot ()
(c:goto)
) ; defun
 

 

eXAPl1 (2).dwg 599.43 kB · 21 downloads

HI BIGAL
I have a lot of maps in AutoCAD model space and it is very difficult to print them one by one.
Does anyone have a LISP file that I can quickly print maps together in AutoCAD? (Similar to this video (https://www.aparat.com/v/GRFpO/), but unfortunately the LISP file attached to this video does not work properly)

Link to comment
Share on other sites

Paper Space was added with r11 to make plotting simple 31 years ago and enhanced in most of the 26 versions since then.

Still seeing threads like this on a regular basis is bewildering.

Link to comment
Share on other sites

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...