Print stacked layers in PDF ?

Print stacked layers in PDF ?

jlc.pub
Enthusiast Enthusiast
1,197 Views
5 Replies
Message 1 of 6

Print stacked layers in PDF ?

jlc.pub
Enthusiast
Enthusiast

Good morning,

 

 

We are working with stacked layers like a workbook.

Each page (folio) is made from 1 layer named "1" "2" "3" and 1 background layer named FDP.

To see page 1, I need to thaw layers 1 & FDP etc...

We have developped a plugin to navigate, insert etc... folios....

 

My problem now is to print all this "folios" in a PDF.

 

I'd like to use layouts to set up the printing settings (A4, PDF or A4, printer...) and then create a lisp to print my folios...

I know how to show each layers step by step but I'm wondering how to queue the folios to print it in one PDF ?

(In a second step, I would like to ask the user which folio he wants to print)

 

I've attached a DWG to help you understand.

 

Thanks for your help !

 

 

 

0 Likes
Accepted solutions (1)
1,198 Views
5 Replies
Replies (5)
Message 2 of 6

cadffm
Consultant
Consultant

Hi,

please share a sample.

 

Program ask for "Which folio?"

Use say [Here the sample answer]

Attach a PDF how it looks like when user selected [Here the sample answer]

 

 

Sebastian

0 Likes
Message 3 of 6

jlc.pub
Enthusiast
Enthusiast

Hi,

 

 

Thanks for your reply. I shared the DWG in the previous post.

Let's stay simple : I want to launch a lisp which print the 2 "folios" in the same PDF.

Folio 1 is the combination of layer 1 and layer FDP.

Folio 2 is the combination of layer 2 and layer FDP.

 

I imagine the command like :

- Call Lisp function

- Go to layout "A4 - PDF"

- thaw layers "FDP" & "1"

- Print it in a PDF

- Freeze layer "1"

- Thaw layer "2"

- Print it in the same PDF.

 

I'm just missing how I can print in the same PDF 🙂

 

 

 

 

0 Likes
Message 4 of 6

cadffm
Consultant
Consultant
Accepted solution

@jlc.pub wrote:

Thanks for your reply. I shared the DWG in the previous post.

I know? I asked for the result (PDF) 😉 But your further description is enough, now. thx.

 

I'm just missing how I can print in the same PDF 🙂


Ok, three possible ways, no one are for beginners (or you search/find/copy&paste existing codes for the second way)

 

v1) Search a PDF driver you can controle by api and which can create multipage pdf's

       This way you can start plotting with multiplage option for this pdf driver and after the last page you send the "End" command.

 

v2) Print from Acad by the usual way, start an external program you can controle by api to merge all pages.

 

v3) Use the internal PDF driver and PUBLISH command

      For this way you need a function that creates DST file ondemand.

      AND: You have to create Layouts for each page separately - because of Publish

 

 

The best way is V1, but such (free) PDF drivers are rare

 

 

 

Sebastian

Message 5 of 6

jlc.pub
Enthusiast
Enthusiast

Thanks,

I will select the 2nd one. I will print all pages in different PDF and merge them afterwards...

 

0 Likes
Message 6 of 6

Sea-Haven
Mentor
Mentor

Here is select a range of layouts and it will make individual pdfs in a directory under the current dwg. You will need to change a few things printer name, sheet size window etc but happy to help. uses a library dcl for range can be used in any code.

 

I use Ghostscript to rejoin pdfs into 1, can post that version as well, bit more on end of this code.

 

 

;Plots layouts by range
; By Alan H Feb 2014
(defun AH:pltlays ( / lay numlay numend)
(SETVAR "PDMODE" 0)

(setvar "fillmode" 1)
(setvar "textfill" 1)

(setq alllays (vla-get-Layouts (vla-get-activedocument (vlax-get-acad-object))))
(setq count (vla-get-count alllays))
(if (not AH:getvalsm)(load "Multi Getvals.lsp"))
(setq vals (AH:getvalsm  (list "Enter plot range" "Enter start tab number" 6 4 "1" "Enter end tab number" 6 4 (RTOS COUNT 2 0))))

(setq numlay (atoi (nth 0 vals)))
(setq numend (atoi (nth 1 vals)))

(setq len (+ (- numend numlay) 1))

(setq dwgname (GETVAR "dwgname"))
(setq lendwg (strlen dwgname))
(setq dwgname (substr dwgname 1 (- lendwg 4)))

(repeat len
(vlax-for lay alllays
(if (= numlay (vla-get-taborder lay))
  (setvar "ctab" (vla-get-name lay))
) ; if
(setq pdfname (strcat (getvar "dwgprefix") "pdf\\" dwgname "-" (getvar "ctab")))

) ; for
(setq lay nil)
(setvar "textfill" 1)
(setvar "fillmode" 1)
    (COMMAND "-PLOT"  "Y"  "" "DWG To PDF"
	       "Iso full bleed A3 (420.00 x 297.00 MM)" "m" "LANDSCAPE"  "N"   "W"  "-6,-6" "807,560" "1=2"  "C"
	       "y" "Acad.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
    )
    
(setq numlay (+ numlay 1))
) ; end repeat
) ; defun

(AH:pltlays)

 

 

 

0 Likes