Jump to content

Plot user paper size


reza

Recommended Posts

Hi everyone,

I have encountered a problem in plotting and I was wondering if anyone here could help me with it.

I need to plot a DWG file on a custom-sized (non-standard) paper whose dimensions must be defined in ‘Plotter Configuration Editor’ or PCE window. Here’s the main question: ‘Is there any way to make my lisp go round PCE and consider two user-picked points (for plot area) as the size of the paper with a predefined name.’

 

 

(setq p1 (getpoint "\n\tPick upper left corner : "))

(setq p2 (getcorner p1 "\n\Pick lower right corner : "))

(setq str1 (getstring “Enter User Paper Name : ”)) ; e.g. “PLOT”

(setq p (itoa (getint “Enter First Setup Number : ”))) ; e.g. “1”

(setq name1 (strcat str1 p)) ; “PLOT1”

;;; I want here calculate the delta x & delta y from p1 & p2 and put this value (e.g. “510*345”)

;;; for custom user paper size :PLOT1=510*345

(commnad "-plot "

"yes"

"model"

"Dwg to Pdf.pc3"

"PLOT1" ;;;;;;;;;;;; user paper size name 510*345

"millimeters"

"landscape"

"no"

p1

p2

"1=1"

.

.

.

.

.

)

plot.dwg

Edited by reza
Link to comment
Share on other sites

  • Replies 46
  • Created
  • Last Reply

Top Posters In This Topic

  • reza

    23

  • maratovich

    8

  • BIGAL

    6

  • mostafa badran

    5

Top Posters In This Topic

Posted Images

Heres an example for a rectangle with 510x345 units size:

(defun C:test ( / p1 p2 deltaX deltaY str )
(and
	(setq p1 (getpoint "\nPick first corner : "))
	(setq p2 (getcorner p1 "\nPick the opposite corner : "))
	(setq deltaX (abs (- (car p1) (car p2))))
	(setq deltaY (abs (- (cadr p1) (cadr p2))))
	(setq str (strcat "\"" (itoa (fix deltaX)) "*" (itoa (fix deltaY)) "\""))
)
(alert str)
(princ)
)

Link to comment
Share on other sites

(setq p1 (getpoint "\nPick first corner : "))

(setq p2 (getcorner p1 "\nPick the opposite corner : "))

(setq deltaX (abs (- (car p1) (car p2))))

(setq deltaY (abs (- (cadr p1) (cadr p2))))

(setq str (strcat (itoa (fix deltaX)) "*" (itoa (fix deltaY))))

(commnad "-plot "

"yes"

"model"

"Dwg to Pdf.pc3"

;;;;;;;"PLOT1" ;;;;;;;;;;;; user paper size name 510*345

 

;;;put this value (e.g. “510*345”)

;;;for custom user paper size PLOT1=510*345

;;;like this

 

 

Enter paper size or [?] : !str

3*2

not found.[/color]

 

"millimeters"

"landscape"

"no"

p1

p2

"1=1"

.

.

.

.

.

)

Link to comment
Share on other sites

If you are plotting from layouts using a title block that is the size you want then its simple just set up the correct plot commands, the example below expects the title block to be at 0,0 so no need for pick window as you know the size of the title block. You can do the same if the title block is not the size you want by adjusting the final layout plot scale do this for my TIFFS scale is 0.127 for a A1 sheet.

 

This is example code highlighted in red is what you would change.

 

(COMMAND "-PLOT" "Y" "" "[color="red"]\\N03\\laser-BW[/color]"
     "[color="red"]A3[/color]" "m"    "LANDSCAPE"	   "N"   "W"  "[color="red"]-6,-6[/color]"    "[color="red"]807,560[/color]"	"1=2"  "C"
       "y"	  "[color="red"]Designlaser.ctb[/color]" "Y"	"N" "N" "N" "N" "N" "y"      )
 )

 

If your plotting in model space again you can plot all title blocks in one go.

Link to comment
Share on other sites

my dear friends

I want set my paper size (e.g. "PLOT1"=> width=450 , height=765) instead of "A3" or "A4" ..........

this (custom paper name & user paper size) is concluded (autolisp code) from p1 & p2

Edited by reza
Link to comment
Share on other sites

You can create your own PCE as per your paper size plot1,plot2,plot3...... and use the following.

(setq pt1(getpoint"\nPick upper left corner: "))
(setq pt2(getcorner pt1 "\nPick lower right corne: "))
(setq pltyp "[color=red]plot1.pc3[/color]")
(setq plstyle "acad.ctb")
(setq plsize "[color=red]plot1[/color]")
(command "-plot" "Yes"  "Model" pltyp plsize
      "Millimeters" "Landscape" "No"
      "Window" pt1  pt2  "Fit" "Center"
      "Yes"  plstyle   "Yes"    "No"   "No"
      "Yes"  "Yes"
     )

HTH.

Link to comment
Share on other sites

Hi Mostafa

it not work in Attachment Files (plot.dwg)

 

(setq pt1(getpoint"\nPick upper left corner: "))

(setq pt2(getcorner pt1 "\nPick lower right corne: "))

(setq pltyp "plot1.pc3")

(setq plstyle "acad.ctb")

(setq plsize "plot1")

(command "-plot" "Yes" "Model"

Enter an output device name or [?] : plot1 not found.

pltyp plsize

"Millimeters" "Landscape" "No"

"Window" pt1 pt2 "Fit" "Center"

"Yes" plstyle "Yes" "No" "No"

"Yes" "Yes"

)

Enter an output device name or [?] : plot1 not found.

I want add user paper size to list of paper size of "Dwg To Pdf.pc3" device

Link to comment
Share on other sites

I create it :

 

1-Click Application menu> Print> Manage Plotters.

2-In the Autodesk Plotter Manager, double-click the Add-a-Plotter Wizard shortcut icon.

 

but i can not create it with lisp code

no problem

 

Now:

 

How to change paper size in added new plotter (PLOT1.pc3) with lisp code ?

Edited by reza
Link to comment
Share on other sites

I create it :

 

1-Click Application menu> Print> Manage Plotters.

2-In the Autodesk Plotter Manager, double-click the Add-a-Plotter Wizard shortcut icon.

 

but i can not create it with lisp code

no problem

 

Now:

 

How to change paper size in added new plotter (PLOT1.pc3) with lisp code ?

 

Sorry I don't know it is possible in auto-lisp or not but I am trying/wait to another person to guide use .

when I look to your sample I found 5 paper custom size if it's only 5 you can do it manually .

Edited by mostafa badran
correction
Link to comment
Share on other sites

it is not problem :

"""Sorry I don't know it is possible in auto-lisp or not but I am trying/wait to another person to guide use .""""

 

no it's not only 5 paper custom size

my Attachment Files (plot.dwg) is a sample may be I have few paper size (9 , 10 , 15 , 23 ........ plot area) in a dwg file . (((paper size=plot area)))

Link to comment
Share on other sites

Once you make the custom size as you said you have done then as per the posts change the lisp code for plotting of sheets as I and others have posted. I think your just not understanding the information we are providing its all there for you to use but you must make some tying changes !

 

I had a look at your dwg and the sizes are just so far off what your asking it makes no sense. We have a template that has 12 different title block layouts all different size sheets, this is the way to go.

 

So make a new template with a layout for each sheet size draw the title details at 1:1 eg draw a rectang say 465x765 on one of the layouts, the others at the size you want. Its possible to auto detect the sheet size using the titleblock name and just plot it correct every time using a lisp, just a bit of patching the code already posted.

 

If you dont know how to use "layouts" then search here there are some excellent tutorials.

 

Were metric and use standard Iso sheet sizes A0 A1 A2 A3 A4 so I don't understand the need for very odd sizes.

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