Jump to content

pagesetup with lisp with several layout A3, A0. A1


CAD

Recommended Posts

I have set it up so it just runs when you appload. Did you save the lisps ie 3 lisps into a directory that has been defined as a supported path, the getval auto loads and must be in a supported path. Maybe add (vl-load-com) in 1st line of code. I tested it on your DWG as posted here and it works fine. I have it setup to be called from a menu. But you could add a shortcut to your Acaddoc.lsp (defun c:pltlays (load "your name here"))

 

Did anything appear the dcl should have popped up.

ScreenShot007.jpg

Link to comment
Share on other sites

  • Replies 32
  • Created
  • Last Reply

Top Posters In This Topic

  • CAD

    14

  • maratovich

    9

  • BIGAL

    8

  • 34cengiz

    2

Top Posters In This Topic

Posted Images

Have put the 3 files in supp path and appload, but nothing appears.

then i try add text in the 4layouts.lsp see below defun c:pltlays () and (vl-load-com)

 

----4layouts.lsp---- see attach files----

 

(defun c:pltlays ()

(vl-load-com)

 

;Plots layouts by range

; By Alan H Feb 2014

; chnaged to recognize title block name

(defun AH:pltlays ( / val1 val2 plotnames dwgname lendwg pdfname lay numlay numend dwgpre lstsheet sc ll ur trgfile)

(SETVAR "PDMODE" 0)

dw.gif

4layouts.lsp

GETVALS3.lsp

mergepdfs.lsp

Link to comment
Share on other sites

I will test it a bit more but it was running fine. I tested at work and had to change the CTB style name then it worked fine. Created 4 pdf's.

 

Please post a screen grab of a manual plot so I can see what is in your plot settings.

Screen Shot 06-26-17 at 01.26 PM.PNG

Link to comment
Share on other sites

Hello Bigal,

 

1.See attachment plot manuel.

2.See attachment 4layouts.lsp modified

2.When use appload then get error:

 

 

 

Command: AP APPLOAD 4layouts.lsp successfully loaded.

Command: Regenerating layout.

Regenerating model.

ddgetval2 : dialog {

: column {

: edit_box {

key = "key1";

label = "Enter start tab number";

edit_width = 6;

edit_limit = 4;

is_enabled = true ;

}

spacer_1 ;

: edit_box {

key = "key2";

label = "Enter end tab number";

edit_width = 6;

edit_limit = 4;

is_enabled = true ;

}

}

spacer_1 ;

ok_only;}

; error: bad argument type: streamp nil

Command:

DWG TO PDF.jpg

4layouts.lsp

Link to comment
Share on other sites

My fault getvals3 writes to a known directory in this case c:\acadtemp. Its a easy fix I do apologise.

 

Use this line for the file path or change \acadtemp to a directory of your choice.

 

(setq fo (open (setq fname "c:\\acadtemp\\getval.dcl") "w"))
or use, writes to temporary directory known by Autocad 
(setq fo (open (setq fname (vl-filename-mktemp "" "" ".dcl")) "w"))
or
(setq fo (open (setq fname "c:\\yourdirectory\\getval.dcl") "w"))

also need to make changes like this for sheet sizes

 
(list "A0-HOR1350" "-6,-6" "1356,847" "A0 1350" "Acad.ctb" "1=1")

Link to comment
Share on other sites

Hello Bigal,

its some how work with dwg to pdf, with some trying and testing hahahaa nicee:shock:! but still have some question.

 

Question 1

When the block not at 0,0,0 it gives problems

; error: bad argument type: lselsetp nil

Command:

 

is there some how it detect the block without 0,0,0,?

 

Question 2

the lisp is finding the exact block for the right paper

but is it possible to make, it find the edges of the block, pline or line of layout and it automatic choose the best fit papersize scale 1=1

so when A0 not fit it will take A0 1350 something like that.

 

Question 3

when change to Cutepdf writer it doesnt work any more?

another setting?

Edited by CAD
Link to comment
Share on other sites

Question 1 is yes I did a simple look for a block at 0,0 you need to look for the block get insertion point then adjust the two corners for the window.

Question 2 can be done like question 1 must have a rule find an object get say its length if > 841 use the 1350

 

Question 3 check the plot settings it will be in the descriptions may have a space somewhere that is hard to see, my version "CutePDF Writer" and "A3"

 

 ; this is example code that finds a block gets insertion point 
;and resets the two window pts for plotting
(setq ss2 (ssget "x" '((0 . "INSERT")(2 . "blockname"))))
(setq en (ssname ss2 0))
   (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" "N" "N" "Y"
   )

Link to comment
Share on other sites

Hello Bigal,

 

Don't know how to combine the code in the 4layout.lsp so it can be work like question 1,2,3? can u please config it for me.

Link to comment
Share on other sites

  • 10 months later...
This is a common theme and the answer has been stated many times. You can use one of the codes posted here that makes a pdf or plot to printer/plotter the only change is that you check the title block or look for a block on that layout that has the desired size as say a name "A1" "A1oversize" "A0" "A3500".

 

If you look at this example its hard coded for a specific size A1 title block making A3 pdf's

(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" "Designlasercolour.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
   )

 

Your version would be something like this after checking sheet size it would set the variables papersize and printername and scale

(COMMAND "-PLOT"  "Y"  "" [color="red"]Printername[/color]
      [color="red"] Papersize[/color] "m" "LANDSCAPE"  "N"   "W"  "-6,-6" "807,560" [color="red"]scale[/color]  "C"
       "y" "acad.ctb" "Y"	"n" "n" "n" pdfName "N" "y"
   )

 

Hope this makes some sense, do you have any skills with lisp ? Full code example was posted by me a couple of days ago similar question, there are numerous examples here just search "PLOT".

 

maratovich also has a universal print solution that may help as well, I am sure he will provide the link for further information.

 

 

Hello Dear Bigal,

 

I have a question for you and I write here because I could not send you private message (Sorry about that). Now, I should convert to pdf my project but I want that all pages in the one ".pdf" file. I have prt lisp but it's converting all pages in different pages. Do you have lisp for convert to pdf all pages in one file and export? Can you help me, Thank you!

Link to comment
Share on other sites

I use ghostscript in conjunction with the plot range. You need to download seperately.

 

Thanks, I'll look.

 

34cengiz

Is your project in the same dwg file or is it different files?

 

Same dwg

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