Community
AutoCAD Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Importing Named Page Setups that plot by window

6 REPLIES 6
Reply
Message 1 of 7
GoldenEye15
1435 Views, 6 Replies

Importing Named Page Setups that plot by window

Hello:

 

I have a library of hundreds of older drawings that print from model view using the plot-by-window method. I also regularly plot three different sizes of paper.

 

In order to streamline this plotting process, I've created named page setups in a .dwt file with an empty title-border. And in the .dwt, these settings remain exactly as they should be (including the size and location of the plotting-window).

 

When I import these named page setups into a .dwg file, the import is successful but the plotting-window is not exactly where it should be. The plotting window is often shifted significantly off its original location as defined in the .dwt file.

 

I've ensured my title-borders are in the exact same place (with the lower-left corner at 0,0,0) and are of the exact same size.

 

This appears to be a quirk because the plotting window is always shifted in different ways. Out of 6 drawings, only one drawing "imported properly" (without having to redefine the plotting-window).

 

Are there any solutions to this issue?

 

P.S. As the first AutoCAD version I learned was 2012, I'm fully aware and supportive of Layout view. There simply isn't time to convert hundreds of drawings over to Layout view from Model view all at once so this is a temporary solution until all drawings are converted.

 

Thank you,

-- GoldenEye15

6 REPLIES 6
Message 2 of 7
pendean
in reply to: GoldenEye15

If you know the exact coordinates, why not just write a simple lisp using -PLOT command? Way quicker than your method, and always exact all the time.
Message 3 of 7
GoldenEye15
in reply to: pendean

The problem is that I don't know how to write a simple Lisp program. I'm completely unfamiliar with the syntax. But I agree that it would be much more efficient than manually doing it.

 

Revision 1:

I'm looking up AutoLISP tutorials and thankfully my background in computer programming is helping me a lot. I have one question, though; what does the "-plot" command do, exactly? I'm running it and I see it requires a plot-setup to already exist. So, I still have to import my page setups, and then use this to modify it?

 

How would I use a LISP program to automatically create the three plot-setups?

Message 4 of 7
pendean
in reply to: GoldenEye15

Why don't you share your three sets of coordinates and the plot parameters here (after you experiment at the command line with -PLOT command and work it all out) and I'm sure someone will jump in and help get you started.
Message 5 of 7
GoldenEye15
in reply to: pendean

That is a good idea. Well here they are:

 

Page setup name: "Setup 1 DWG"

Enter a layout name or [?] <Model>:
Enter an output device name or [?] <\\SERVER\STPQ247 - HP LaserJet 9040>:
Enter paper size or [?] <11x17>:
Enter paper units [Inches/Millimeters] <Millimeters>:
Enter drawing orientation [Portrait/Landscape] <Landscape>:
Plot upside down? [Yes/No] <No>:
Enter plot area [Display/Extents/Limits/View/Window] <Window>:
Enter lower left corner of window <-53.540381,-6.990000>:

Enter upper right corner of window <797.000000,537.000000>:

Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <Fit>: 1=2
Enter plot offset (x,y) or [Center] <0.00,0.00>:
Plot with plot styles? [Yes/No] <Yes>:
Enter plot style table name or [?] (enter . for none) <rev012_monochrome_Half_Size.ctb>:
Plot with lineweights? [Yes/No] <Yes>:
Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] <As displayed>:
Write the plot to a file [Yes/No] <N>: No
Save changes to page setup [Yes/No]? <N> Yes
Proceed with plot [Yes/No] <Y>: N

 

Page setup name: "Setup 2 PDF"
Enter a layout name or [?] <Model>:
Enter an output device name or [?] <DWG To PDF.pc3>:
Enter paper size or [?] <ANSI expand B (11.00 x 17.00 Inches)>:
Enter paper units [Inches/Millimeters] <Millimeters>: M
Enter drawing orientation [Portrait/Landscape] <Landscape>: L
Plot upside down? [Yes/No] <No>: N
Enter plot area [Display/Extents/Limits/View/Window] <Window>: W
Enter lower left corner of window <-30.38518343, 533.99006460>:

Enter upper right corner of window <794.13507104, -2.70660272>:

Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <1=2>:
Enter plot offset (x,y) or [Center] <0.00,0.00>:
Plot with plot styles? [Yes/No] <Yes>: Y
Enter plot style table name or [?] (enter . for none) <rev012_monochrome_Half_Size.ctb>:
Plot with lineweights? [Yes/No] <Yes>: Y
Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] <As displayed>: A
Save changes to page setup [Yes/No]? <N> Y
Proceed with plot [Yes/No] <N>:

 

Page setup name: "Setup 3 PDF"
Enter a layout name or [?] <Model>:
Enter an output device name or [?] <DWG To PDF.pc3>:
Enter paper size or [?] <ANSI expand A (8.50 x 11.00 Inches)>:
Enter paper units [Inches/Millimeters] <Millimeters>: M
Enter drawing orientation [Portrait/Landscape] <Landscape>: L
Plot upside down? [Yes/No] <No>: N
Enter plot area [Display/Extents/Limits/View/Window] <Window>: W
Enter lower left corner of window <-16.01714556, -3.75000000>:

Enter upper right corner of window <793.53553391, 536.00000000>:

Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] <Fit>:
Enter plot offset (x,y) or [Center] <Center>:
Plot with plot styles? [Yes/No] <Yes>: Y
Enter plot style table name or [?] (enter . for none) <rev012_monochrome_Half_Size.ctb>:
Plot with lineweights? [Yes/No] <Yes>: Y
Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] <As displayed>: A
Save changes to page setup [Yes/No]? <N> Y
Proceed with plot [Yes/No] <Y>: N

Message 6 of 7
GoldenEye15
in reply to: GoldenEye15

I've added all the parameters for the 3 page setups
Message 7 of 7
GoldenEye15
in reply to: GoldenEye15

I have figured out most of the problem. Refer to the +plot function definition. What I'd like it to do, is execute the "-PLOT" command with all the parameters supplied and then saves the setting to a Named Page Setup with the addPageSetup function. But the way it written now, the -PLOT execution doesn't work in AutoCAD. AutoCAD is reading each of those parameters as a new function.

 

Is it possible for the -plot execution to be rewritten to accept the succeeding strings as parameters?

 

(vl-load-com)

; add a new page setup name to current layout-type based on current plot configuration
; (addPageSetup <AcadDocument> <PageSetupName>)
; (addPageSetup (vla-get-activedocument (vlax-get-acad-object)) "PageSetupName")
(defun addPageSetup (doc name / space pc lay)
  (deletePageSetup doc name)
  (if (= (getvar "ctab") "Model")
    (setq space :vlax-true
          lay (vla-get-Layout (vla-get-ModelSpace
                (vla-get-activedocument (vlax-get-acad-object)))))
    (setq space :vlax-false
          lay (vla-get-ActiveLayout (vla-get-activedocument
                (vlax-get-acad-object))))
  )
  (setq pc (vla-add
             (vla-get-plotconfigurations doc)
             name
             space))
  (vla-CopyFrom pc lay)
  (vla-put-name pc name)
)

(defun c:+plot ()
  	;set plot parameters
  	(COMMAND "-PLOT" "Y" "Model" "\\SERVER\STPQ247 - HP LaserJet 9040" "11x17" "Millimeters" "Landscape" "No" "Window" "-53.540381,-6.990000" "797.000000,537.000000" "1=2" "0.00,0.00" "Yes" "rev012_monochrome_Half_Size.ctb" "Yes" "As displayed" "No" "Yes" "No")
	(addPageSetup (vla-get-activedocument (vlax-get-acad-object)) "Page Setup 1")
	(princ)
)

(PRINC)

 P.S. I'm sure this script looks like garbage. I don't know any better when it comes to LISP, however so please dont scrutinize it too harshly.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost