Message 1 of 14
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello can someone please help me with this code:
This is lisp for plotting.
#1. it ask user to select text object that contains filename for plotting pdf
#2. It ask to pick two opposite corners for plot window
#3. plot pdf.
My question: Is it possible for it to loop #1 and #2 untill "T"-key is pressed after #2, ending the loop and proceedeng to to #3 = plotting as many pdf´s as I have looped.
Also I think it would be neccesary/awsome for it to check that user dont pick same name nor corners twice
Currently working code:
(defun c:PlotLS (/ FirstCorner SecondCorner Filename )
(setq Filename (cdr (assoc 1 (entget (car (entsel "\nSelect filename: "))))))
(setq FirstCorner (getpoint "
Pick a point or type coordinate: ")) ;this will ask for user input
(setq SecondCorner (getpoint "
Pick a point or type coordinate: ")) ;this will ask for user input
(command "-plot"
"yes" ; Detailed plot configuration? [Yes/No] <No>:
"" ; Enter a layout name or [?] <Model>:
"DWG TO PDF.PC3" ; Enter an output device name or [?] <None>:
"ISO full bleed A4 (210.00 X 297.00 mm)" ; Enter paper size or [?] <ISO A4 (210.00 x 297.00 MM)>:
"Millimeters" ; Enter paper units [Inches/Millimeters] <Millimeters>:
"Landscape" ; Enter drawing orientation [Portrait/Landscape] <Portrait>:
"No" ; Plot upside down? [Yes/No] <No>:
"Window" ; Enter plot area [Display/Extents/Limits/View/Window] <Display>:
FirstCorner;
SecondCorner;
"Fit" ; Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <Fit>:
"Center" ; Enter plot offset (x,y) or [Center] <11.00,11.00>:
"yes" ; Plot with plot styles? [Yes/No] <Yes>:
"monochrome.ctb" ; Enter plot style table name or [?] (enter . for none) <>:
"yes" ; Plot with lineweights? [Yes/No] <Yes>:
"As displayed" ; Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] <As displayed>:
(strcat (getvar 'DWGPREFIX) Filename ".pdf")
"no" ; Save changes to page setup [Yes/No]? <N>
"Yes" ; Proceed with plot [Yes/No] <Y>:
)
)
Solved! Go to Solution.