reza Posted November 12, 2016 Share Posted November 12, 2016 (edited) 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 November 12, 2016 by reza Quote Link to comment Share on other sites More sharing options...
maratovich Posted November 12, 2016 Share Posted November 12, 2016 Add example of your .dwg file. Quote Link to comment Share on other sites More sharing options...
reza Posted November 12, 2016 Author Share Posted November 12, 2016 thx maratovich for reply plot.dwg Quote Link to comment Share on other sites More sharing options...
Grrr Posted November 12, 2016 Share Posted November 12, 2016 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) ) Quote Link to comment Share on other sites More sharing options...
reza Posted November 12, 2016 Author Share Posted November 12, 2016 (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" . . . . . ) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 13, 2016 Share Posted November 13, 2016 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. Quote Link to comment Share on other sites More sharing options...
reza Posted November 13, 2016 Author Share Posted November 13, 2016 (edited) 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 November 13, 2016 by reza Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 14, 2016 Share Posted November 14, 2016 Once you create a paper size and save its available for any future plots and can be just picked in my post as I said change the red values "A3" would now be "450x765" Quote Link to comment Share on other sites More sharing options...
reza Posted November 14, 2016 Author Share Posted November 14, 2016 :oops: oh my god please see my Attachment Files (plot.dwg) I have few area and paper size in one file Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted November 14, 2016 Share Posted November 14, 2016 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. Quote Link to comment Share on other sites More sharing options...
reza Posted November 14, 2016 Author Share Posted November 14, 2016 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 Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted November 14, 2016 Share Posted November 14, 2016 Did you create plot1.pc3 with custom paper size ? Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted November 14, 2016 Share Posted November 14, 2016 This link helpful to add plot1.pc3 with custom paper size. HTH. Quote Link to comment Share on other sites More sharing options...
reza Posted November 14, 2016 Author Share Posted November 14, 2016 salam mostafa No I can not create plot1.pc3 with custom paper size Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted November 14, 2016 Share Posted November 14, 2016 salam mostafa No I can not create plot1.pc3 with custom paper size This link helpful to add plot1.pc3 with custom paper size.HTH. So ,you can follow the previous post. Quote Link to comment Share on other sites More sharing options...
reza Posted November 14, 2016 Author Share Posted November 14, 2016 (edited) 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 November 14, 2016 by reza Quote Link to comment Share on other sites More sharing options...
mostafa badran Posted November 14, 2016 Share Posted November 14, 2016 (edited) 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 November 14, 2016 by mostafa badran correction Quote Link to comment Share on other sites More sharing options...
reza Posted November 14, 2016 Author Share Posted November 14, 2016 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))) Quote Link to comment Share on other sites More sharing options...
ReMark Posted November 14, 2016 Share Posted November 14, 2016 How many "custom" paper sizes do you anticipate needing and why? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 15, 2016 Share Posted November 15, 2016 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.