<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: LISP to set plot setup in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895671#M137285</link>
    <description>&lt;P&gt;When I comment out '(vla-put-CanonicalMediaName lay PaperSize)' then all the settings seem to come back in when I run the LISP (before it wouldn't set the units to mm, extents etc). I also removed the '(vla-put-PlotRotation lay "0")' after 'setq PaperSize "A4") for all the sizes but still no luck. I have a feeliing I have missed something and it's not just plain "A4" etc for selecting the papersize but that's the options Adobe PDF give in the drop down menu.&lt;/P&gt;</description>
    <pubDate>Fri, 06 Nov 2015 05:31:17 GMT</pubDate>
    <dc:creator>joe_gio</dc:creator>
    <dc:date>2015-11-06T05:31:17Z</dc:date>
    <item>
      <title>LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881184#M137270</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Our company is now using a document management system to store and view our drawings (viewed as PDF's). For the PDF's to be shown correctly the plot setup has to be correct or else the PDF looks like crap. I've been trying to think of the best way to set this up so it can be done through a LISP or script between the different groups. Using the &lt;A href="http://www.lee-mac.com/lisp/ObjectDBXWrapperV1-2.lsp" rel="nofollow" target="_blank"&gt;ObjectDBX Wrapper Lisp&lt;/A&gt; lisp from Lee Mac and the below code thanks to Ajilal I can set the CTB file to all the drawings in a folder. What I didn't realise is that they need the make sure the printer is always the same (Adobe PDF), plot area is extents, centre plot, fit to paper, plot lineweights is off and the fun part of making sure the paper size is correct and the orientation. We're now about to roll out a new standard border that's created as a block so I was thinking with an 'if' function maybe it could detect the block then apply the correct settings. On the other hand we also have a bunch of older drawings moving to our DM system that are in Model space and there's no defined border block, just a bunch of lines. Is it possible to detect the outer limits of the drawing in a model space then apply the print setup?&lt;/P&gt;&lt;P&gt;Sorry for the trouble I know it's a big ask. I'm not sure if I could incorporate so much into the below code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:RV ( / )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (LM:ODBX&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (function&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (lambda ( doc )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ (strcat "\nOpening file : "(vla-get-name doc)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vlax-for lay (vla-get-layouts doc)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-stylesheet lay "StandardCTB.ctb")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ (strcat "\nCTB changed for : "(vla-get-name lay)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);vlax-for&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nil t&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;);defun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks to the help of the community I also have this code below&amp;nbsp;that would set the CTB via a script. If the above code isn't capable of the options needed would I be better to try and add it to the below code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun C:RV ( / COUNT DIR FILENAME FILES SCRIPTNAME)&lt;BR /&gt;(if (setq dir (getfiled "Select the drawing directory:" "" "dwg" 0))&lt;BR /&gt;(setq dir (vl-filename-directory dir))&lt;BR /&gt;)&lt;BR /&gt;(if dir&lt;BR /&gt;(setq files (vl-directory-files dir "*.dwg" 1))&lt;BR /&gt;)&lt;BR /&gt;(if files&lt;BR /&gt;(progn&lt;BR /&gt;(setq scriptname (open (strcat "C:\\Users\\" (getenv"username") "\\Desktop\\batch.scr") "w")&lt;BR /&gt;count 0&lt;BR /&gt;)&lt;BR /&gt;(while (setq filename (nth count files))&lt;BR /&gt;(setq filename (strcat dir "\\" filename))&lt;BR /&gt;(write-line (strcat "_open \"" filename "\"") scriptname)&lt;/P&gt;&lt;P&gt;&amp;nbsp;(write-line "(setq *acad-object* (vlax-get-acad-object))" scriptname)&lt;BR /&gt;&amp;nbsp;(write-line "(setq *active-document* (vla-get-activedocument *acad-object*))" scriptname)&lt;BR /&gt;&amp;nbsp;(write-line "(setq *active-layout* (vla-get-activelayout *active-document*))" scriptname)&lt;BR /&gt;&amp;nbsp;(write-line "(vla-put-stylesheet *active-layout* \"StandardCTB.ctb\")" scriptname)&lt;/P&gt;&lt;P&gt;(write-line "_qsave" scriptname)&lt;BR /&gt;(write-line "_close" scriptname)&lt;BR /&gt;(setq count (1+ count))&lt;BR /&gt;)&lt;BR /&gt;(close scriptname)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again everyone.&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 02:24:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881184#M137270</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-10-28T02:24:38Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881221#M137271</link>
      <description>&lt;P&gt;Joe,&lt;/P&gt;
&lt;P&gt;You can do this again with ObjectDBX.&lt;/P&gt;
&lt;P&gt;Modify the previous code as shown below[I also added the code to avoid Model space, if you need to setup Modelspace remove the blue highlighted lines]&lt;/P&gt;
&lt;PRE&gt;(defun c:RV ( / )
    (LM:ODBX
        (function
            (lambda ( doc )
				(princ (strcat "\nOpening file : "(vla-get-name doc)))
				(vlax-for lay (vla-get-layouts doc)
				&lt;FONT color="#0000FF"&gt;(if ( /= "Model"(vla-get-name lay))&lt;/FONT&gt;
				&lt;FONT color="#0000FF"&gt;(progn&lt;/FONT&gt;
					(vla-put-ConfigName lay "Adobe PDF")
					(vla-put-CanonicalMediaName lay "A4")					
					(vla-put-stylesheet lay "Grayscale.ctb")&lt;BR /&gt;                                        &lt;FONT color="#999999"&gt;;;-----Add other settings here from the below lsit&lt;/FONT&gt;
				(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
				&lt;FONT color="#0000FF"&gt;);progn
				);if&lt;/FONT&gt;
				);vlax-for
            )
        )
        nil t
    )
    (princ)
);defun&lt;/PRE&gt;
&lt;P&gt;Other settings you can add from the below list, they are just straightforward, add &lt;STRONG&gt;&lt;FONT color="#339966"&gt;vla-put-&lt;/FONT&gt;&lt;/STRONG&gt; with the below properties.&lt;/P&gt;
&lt;PRE&gt; Property values:
;   CanonicalMediaName = "A4"
;   CenterPlot = -1
;   ConfigName = "Adobe PDF"
;   Document (RO) = #&amp;lt;VLA-OBJECT IAxDbDocument 000000003d908470&amp;gt;
;   Handle (RO) = "59"
;   HasExtensionDictionary (RO) = -1
;   ModelType (RO) = 0
;   Name = "Layout1"
;   ObjectID (RO) = 43
;   ObjectName (RO) = "AcDbLayout"
;   OwnerID (RO) = 45
;   PaperUnits = 0
;   PlotHidden = 0
;   PlotOrigin = (-3545.6 -5108.84)
;   PlotRotation = 1
;   PlotType = 4
;   PlotViewportBorders = 0
;   PlotViewportsFirst = -1
;   PlotWithLineweights = -1
;   PlotWithPlotStyles = -1
;   ScaleLineweights = 0
;   ShowPlotStyles = 0
;   StandardScale = 0
;   StyleSheet = "Grayscale.ctb"
;   TabOrder = 1
;   UseStandardScale = 0
;   ViewToPlot = ""&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 04:29:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881221#M137271</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-10-28T04:29:41Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881254#M137272</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tried putting your code together below but it doesn't seem to want to run. When I comment out the vla portions with ; and just leave the Grayscale.ctb then that works but then I try to add ConfigName or CenterPlot and it does't seem to work. I've tried turning them on and off in the plot settings to see if they change and tried -1 and 0 but again nothing seems to happen. I'm also unsure on what 'CanonicalMediaName lay' does in the code?&lt;/P&gt;&lt;P&gt;Is it possible for it to determine the width and height of the working space in either model space or layout space&amp;nbsp;then apply A1, A2, A3 or&amp;nbsp;A4 paper size? Eventually the drawings should move to a new border that has a block name such as 'A4_DRG' but I think for a long time it'll be a mix of just broken borders and block borders.&lt;/P&gt;&lt;P&gt;Thanks again Ajilal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:RV ( / )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (LM:ODBX&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (function&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (lambda ( doc )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ (strcat "\nOpening file : "(vla-get-name doc)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vlax-for lay (vla-get-layouts doc)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-ConfigName lay "CutePDF Writer")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;;(vla-put-CanonicalMediaName lay "A4")&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-stylesheet lay "Grayscale.ctb")&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-CenterPlot =-1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PlotWithLineweights = -1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PlotWithPlotStyles = -1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);vlax-for&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nil t&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;);defun&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 05:45:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881254#M137272</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-10-28T05:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881639#M137273</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;Sorry for the late reply, was busy in a meeting.&lt;/P&gt;
&lt;P&gt;You got error on your code as you use the '=' sign and forgot to add 'lay'.&lt;/P&gt;
&lt;P&gt;'lay' in this code represents the each layouts in the drawing (like Model, Layout1, Layout2.......etc)&lt;/P&gt;
&lt;P&gt;And the CanonicalName is the property where you set the papersize.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think when you set the Modelspace plot settings to to use 'Plot Extens' that should cover the entire objects in the Modelspace.&lt;/P&gt;
&lt;P&gt;And to determine the size of paper should use there may need some additional code to calcualte.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the code, please check this.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:RV ( / )
    (LM:ODBX
        (function
            (lambda ( doc )
		(princ (strcat "\nOpening file : "(vla-get-name doc)))
		(vlax-for lay (vla-get-layouts doc)
			(vla-put-ConfigName lay "Adobe PDF");set the plotter
			(vla-put-CanonicalMediaName lay "A3");set the paper size
			(vla-put-PlotType lay "1");plot area extens
			(vla-put-CenterPlot lay "1");center plot
			(vla-put-PlotWithLineweights lay "1")
			(vla-put-PlotWithPlotStyles lay "1")
			(vla-put-stylesheet lay "Grayscale.ctb");set  the CTB
			(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
		);vlax-for
            )
        )
        nil t
    )
    (princ)
);defun&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 Oct 2015 12:21:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5881639#M137273</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-10-28T12:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5883084#M137274</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;That's brilliant, sorted out my current issue and I've added a couple more lines you had on the list to 'fit to paper' and set the units mm. I was a bit frustrated at first because it wasn't working at all then I remember I forgot to set the ObjectWrapper to autoload all the time, haha.&lt;/P&gt;&lt;P&gt;I guess it would be a bit too complex if even possible for a model space to try and figure out it's height and width then apply the correct 'CanonicalMediaName' on that but if we did use the new blocks for the border which have names such as A4 or A3 for landscape could an 'if' function or something similar be added to 'CanonicalMediaName'? So 'if' block A4 is found then 'CanonicalMediaName lay A4' elseif A3 is used&amp;nbsp;'CanonicalMediaName lay A3'.&lt;/P&gt;&lt;P&gt;Thanks Ajilal.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 01:51:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5883084#M137274</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-10-29T01:51:42Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5883201#M137275</link>
      <description>&lt;DIV class="lia-message-body-content"&gt;&lt;BR /&gt;
&lt;DIV style="margin: 10px; border: 1px solid #000000; padding: 0.5em; background-color: #FCEFB7;"&gt;joe_gio wrote:&lt;BR /&gt;
&lt;P&gt;and I've added a couple more lines you had on the list to &lt;STRONG&gt;'fit to paper'&lt;/STRONG&gt; and set the units mm.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;I wonder why you need to determine the paper size as you are using 'fit to paper' and 'extens' in the plot options.&lt;/P&gt;
&lt;P&gt;I think you can make pdf from the modelspace with the above settings you applied, by using any papersize (A3, A2 or A1)&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 05:15:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5883201#M137275</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-10-29T05:15:43Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5883217#M137276</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;I was thinking something similar before, maybe just making the PDF A2 in size so they should be a decent quality no matter what size the drawing is. The only issue I could think of is when printing PDF's in a group (I was doing this the other day). I batch PDF'd a bunch of drawings at A4 and A3 sizes and I was also asked for a paper copy so I just selected all the PDF's in the folder, right click and print. As long as the 'Choose paper source by PDF page size' was selected it was easy. This would be more for the engineers/technicians if they wanted to print groups of PDF's after they've saved them from our Document Management system. Was just an idea to get it that little closer to a more streamline setup. I was trying to look into 'if' functions and also noticed 'conditional' options but I'm not sure how I would implement them correctly. I guess if it works by recognising the block which we use for the border then if it's an older model space drawing that has no block it could default to A2.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Oct 2015 05:53:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5883217#M137276</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-10-29T05:53:39Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5885359#M137277</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;Try with something like this.&lt;/P&gt;
&lt;P&gt;Change the text in &lt;FONT color="#FF6600"&gt;Orange color&lt;/FONT&gt; to your plotter settings and the &lt;FONT color="#FF00FF"&gt;title block names&lt;/FONT&gt;.&lt;/P&gt;
&lt;P&gt;Also please update the &lt;FONT color="#3366FF"&gt;default paper size&lt;/FONT&gt; for Modelspace and Papersize&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;(defun c:RV ( / )
    (LM:ODBX
        (function
            (lambda ( doc )
	(princ (strcat "\nOpening file : "(vla-get-name doc)))
	(vlax-for lay (vla-get-layouts doc)
		
		(if ( = "Model" (vla-get-name lay))
			(progn
			(setq PaperSize "&lt;FONT color="#FF6600"&gt;ISO_A2_(594.00_x_420.00_MM)&lt;/FONT&gt;");-----&lt;FONT color="#3366FF"&gt;default paper size for Modelspace&lt;/FONT&gt;
			(princ "\nSearching in Model space for Title Block")
			(vlax-for blk (vla-get-blocks doc)
			(cond
				(( = (vla-get-name blk) "&lt;FONT color="#FF00FF"&gt;Title_A4&lt;/FONT&gt;") (setq PaperSize "&lt;FONT color="#FF6600"&gt;ISO_A4_(297.00_x_210.00_MM)&lt;/FONT&gt;"))
				(( = (vla-get-name blk) "&lt;FONT color="#FF00FF"&gt;Title_A3&lt;/FONT&gt;") (setq PaperSize "&lt;FONT color="#FF6600"&gt;ISO_A3_(420.00_x_297.00_MM)&lt;/FONT&gt;"))
				(( = (vla-get-name blk) "&lt;FONT color="#FF00FF"&gt;Title_A1&lt;/FONT&gt;") (setq PaperSize "&lt;FONT color="#FF6600"&gt;ISO_A1_(841.00_x_594.00_MM)&lt;/FONT&gt;"))
			);cond
			);vlax-for blocks
			(princ (strcat "\nPaper Size for Model Space : " PaperSize))
			);progn
			(setq PaperSize "&lt;FONT color="#FF6600"&gt;ISO_A3_(420.00_x_297.00_MM)&lt;/FONT&gt;");-----&lt;FONT color="#3366FF"&gt;default paper size for Paperspace&lt;/FONT&gt;
		);if model space
			
		(vla-put-ConfigName lay "&lt;FONT color="#FF6600"&gt;DWG To PDF.pc3&lt;/FONT&gt;");set the plotter
		(vla-put-CanonicalMediaName lay PaperSize);set the paper size
		(vla-put-PlotType lay "1");plot area extens
		(vla-put-CenterPlot lay "1");center plot
		(vla-put-PlotWithLineweights lay "1")
		(vla-put-PlotWithPlotStyles lay "1")
		(vla-put-stylesheet lay "Grayscale.ctb");set  the CTB
		(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
	);vlax-for
	(princ "\n--------------------------------------------------")
            )
        )
        nil t
    )
    (princ)
);defun &lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Oct 2015 09:48:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5885359#M137277</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-10-30T09:48:47Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887823#M137278</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;Hope you had a good weekend!&lt;/P&gt;&lt;P&gt;I've tried the code below and everything is working perfectly apart from setting the papersize. It doesn't default to A2 and it doesn't seem to find the block&amp;nbsp;that I set&amp;nbsp;to A3 in my trial drawings. Any idea what the issue might be?&lt;/P&gt;&lt;P&gt;Thanks Ajilal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 00:43:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887823#M137278</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-02T00:43:56Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887915#M137279</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;In the attached image on your post, the block name doesn't have underscore.&lt;/P&gt;
&lt;P&gt;But you have used underscore in the code.So use the exact block name in the code.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;(vla-get-name blk) "&lt;STRONG&gt;A3 Drawing Sheet&lt;/STRONG&gt;")&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also no need to uncomment or change this line.&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;(vla-put-CanonicalMediaName lay &lt;STRONG&gt;PaperSize&lt;/STRONG&gt;).&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is what happens when you run the code.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In each drawing the code is looping through the Layouts (Model, Layout1, Layout2....etc)&lt;/LI&gt;
&lt;LI&gt;Then the code will assign the &lt;STRONG&gt;PaperSize&lt;/STRONG&gt; variable to A2 size.&lt;/LI&gt;
&lt;LI&gt;And if the code found the block name(&lt;STRONG&gt;A3 Drawing Sheet&lt;/STRONG&gt;) in the Modelspace, &lt;STRONG&gt;PaperSize&lt;/STRONG&gt; variable value will change to A3.&lt;/LI&gt;
&lt;LI&gt;For the Layouts the Papersize will be always A2.&lt;/LI&gt;
&lt;LI&gt;Then at this line &lt;FONT color="#0000FF"&gt;(vla-put-CanonicalMediaName lay &lt;STRONG&gt;PaperSize&lt;/STRONG&gt;)&lt;/FONT&gt;, the papersize will assign to the Layout.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Mon, 02 Nov 2015 04:08:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887915#M137279</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-11-02T04:08:26Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887944#M137280</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That's got it going now thanks. You mentioned that the layouts will always be A2, if the block is found in the layout instead of the model can it then apply the correct paper size to the layout? Also would the layout tab have to be called layout1 etc or could it be called anything?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from that it's working perfect for the model space now. I may just have to add in a line at the bottom to define the rotation of the border for layouts as it's fixed A2 papersize at the moment is the wrong rotation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again Ajilal &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 05:34:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887944#M137280</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-02T05:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887964#M137281</link>
      <description>&lt;DIV class="lia-message-body-content"&gt;
&lt;DIV style="margin: 10px; border: 1px solid #000000; padding: 0.5em; background-color: #fcefb7;"&gt;joe_gio wrote:&lt;BR /&gt;
&lt;P&gt;if the block is found in the layout instead of the model can it then apply the correct paper size to the layout?&lt;/P&gt;
&lt;P&gt;Also would the layout tab have to be called layout1 etc or could it be called anything?&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;So you want to look for the Title block in Paperspace also ? If yes, please try this code.&lt;/P&gt;
&lt;P&gt;I have removed the 'If' condition for Modelspace.Now if the code finds the Block, then that Papersize will be used, else A2.&lt;/P&gt;
&lt;P&gt;Click the +sign to see the Code&lt;/P&gt;
&lt;LI-SPOILER&gt;&amp;nbsp;
&lt;PRE&gt;(defun c:RV ( / )
    (LM:ODBX
        (function
            (lambda ( doc )
		(princ (strcat "\nOpening file : "(vla-get-name doc)))
		(vlax-for lay (vla-get-layouts doc)

			; (if ( = "Model" (vla-get-name lay))
				; (progn
				(setq PaperSize "ISO_A2_(594.00_x_420.00_MM)");-----default paper size
				
				(princ "\nSearching for Title Block")
				(vlax-for blk (vla-get-blocks doc)
				(cond
					(( = (vla-get-name blk) "Title_A4") (setq PaperSize "ISO_A4_(297.00_x_210.00_MM)"))
					(( = (vla-get-name blk) "A3 Drawing Sheet") (setq PaperSize "ISO_A3_(420.00_x_297.00_MM)"))
					(( = (vla-get-name blk) "Title_A2") (setq PaperSize "ISO_A2_(594.00_x_420.00_MM)"))
					(( = (vla-get-name blk) "Title_A1") (setq PaperSize "ISO_A1_(841.00_x_594.00_MM)"))
				);cond
				);vlax-for blocks
				(princ (strcat "\nPaper Size Assigned : " PaperSize))
				; );progn
			; );if model space


			(vla-put-ConfigName lay "DWG To PDF.pc3")	;set the plotter
			(vla-put-CanonicalMediaName lay PaperSize)		;set the paper size---&amp;gt;
			(vla-put-PlotType lay "1")			;plot area extens
			(vla-put-CenterPlot lay "1")			;center plot
			(vla-put-PaperUnits lay "1")			;set units to mm
			(vla-put-PlotWithLineweights lay "0")		;turn off lineweights
			(vla-put-PlotWithPlotStyles lay "1")		;turn on plot styles
			(vla-put-StandardScale lay "0")			;fit to paper
			(vla-put-stylesheet lay "Grayscale.ctb")	;set  the CTB
			(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
		);vlax-for
		(princ "\n--------------------------------------------------")
            )
        )
        nil t
    )
    (princ)
);defun&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;Your layout names can be anything, just as an example I mentioned Layoyt1 and Layout2&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 06:19:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5887964#M137281</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-11-02T06:19:26Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5888016#M137282</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I remembered you mentioned that similar mod earlier on but I forgot to comment out '(setq PaperSize "ISO_A2_(594.00_x_420.00_MM)");-----default paper size for Paperspace'. That's it up and working now, I think it's pretty much good to go. I'll try and get our doc control group to give it a test run on some drawings and see how they go.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I added '(vla-put-PlotRotation lay "1")' to the different paper sizes so they are PDF'd the right way (some drawings were in portrait orientation while being PDF'd landscape etc).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again Ajilal, you've been a massive help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 07:48:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5888016#M137282</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-02T07:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5888034#M137283</link>
      <description>&lt;P&gt;You're Welcome, Joe. Glad I could help.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Nov 2015 08:03:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5888034#M137283</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-11-02T08:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895574#M137284</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;I was trying to set up the LSP to work with the Adobe PDF printer that our Doc Control team is using. I set it up below but it doesn't seem to be working correctly at all for A1 and A2 borders and on one of the A3 borders it doesn't set the orientation correclty. It works perfect with the 'DWG to PDF.pc3' but seems to have issued when I set it for 'Adobe PDF'. Any clues what might be causing the issue? I tried removing the '(vla-put-PlotRotation lay "0")' on them all but A1 and A2 still had issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Ajilal.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:RV ( / )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (LM:ODBX&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (function&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; (lambda ( doc )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;(princ (strcat "\nOpening file : "(vla-get-name doc)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;(vlax-for lay (vla-get-layouts doc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;; (if ( = "Model" (vla-get-name lay))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; (progn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(setq PaperSize "A2");-----default paper size for Modelspace&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ "\nSearching in Model space for Title Block")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vlax-for blk (vla-get-blocks doc)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(cond&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(( = (vla-get-name blk) "A4L Drawing Sheet") (setq PaperSize "A4")(vla-put-PlotRotation lay "0"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(( = (vla-get-name blk) "A4 Drawing Sheet") (setq PaperSize "A4")(vla-put-PlotRotation lay "1"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(( = (vla-get-name blk) "A3 Drawing Sheet") (setq PaperSize "A3")(vla-put-PlotRotation lay "0"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(( = (vla-get-name blk) "A3P Drawing Sheet") (setq PaperSize "A3")(vla-put-PlotRotation lay "1"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(( = (vla-get-name blk) "A2 Drawing Sheet") (setq PaperSize "A2")(vla-put-PlotRotation lay "0"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(( = (vla-get-name blk) "A1 Drawing Sheet") (setq PaperSize "A1")(vla-put-PlotRotation lay "0"))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);cond&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;);vlax-for blocks&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ (strcat "\nPaper Size for Model Space : " PaperSize))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; );progn&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;; (setq PaperSize "A2");-----default paper size for Paperspace&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;; );if model space&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-ConfigName lay "Adobe PDF")&amp;nbsp;&amp;nbsp;;set the plotter&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-CanonicalMediaName lay PaperSize)&amp;nbsp;;set the paper size&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PlotType lay "1")&amp;nbsp;&amp;nbsp;&amp;nbsp;;plot area extens&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-CenterPlot lay "1")&amp;nbsp;&amp;nbsp;&amp;nbsp;;center plot&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PaperUnits lay "1")&amp;nbsp;&amp;nbsp;&amp;nbsp;;set units to mm&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PlotWithLineweights lay "0")&amp;nbsp;&amp;nbsp;;turn off lineweights&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PlotWithPlotStyles lay "1")&amp;nbsp;&amp;nbsp;;turn on plot styles&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-StandardScale lay "0")&amp;nbsp;&amp;nbsp;&amp;nbsp;;fit to paper&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-PlotRotation lay "0")&amp;nbsp;&amp;nbsp;&amp;nbsp;;Drawing orientation 1=portrait 0=landscape&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(vla-put-stylesheet lay "Grayscale.ctb")&amp;nbsp;;set&amp;nbsp; the CTB&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;(princ (strcat "\nPlot settings done for : "(vla-get-name lay)))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;);vlax-for&lt;BR /&gt;&amp;nbsp;&amp;nbsp;(princ "\n--------------------------------------------------")&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; nil t&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; )&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; (princ)&lt;BR /&gt;);defun&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 02:28:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895574#M137284</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-06T02:28:42Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895671#M137285</link>
      <description>&lt;P&gt;When I comment out '(vla-put-CanonicalMediaName lay PaperSize)' then all the settings seem to come back in when I run the LISP (before it wouldn't set the units to mm, extents etc). I also removed the '(vla-put-PlotRotation lay "0")' after 'setq PaperSize "A4") for all the sizes but still no luck. I have a feeliing I have missed something and it's not just plain "A4" etc for selecting the papersize but that's the options Adobe PDF give in the drop down menu.&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 05:31:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895671#M137285</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-06T05:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895692#M137286</link>
      <description>&lt;P&gt;After some more fault finding it looks like it's only the A1 and A2 border that's having issues. Looks like it works fine for A3 and A4. Strange how it works fine for one plotter but not the other.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Opening file : A1_DRG_SHT.dwg&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A1&lt;BR /&gt;C:\Users\User\Desktop\Trial\A1_DRG_SHT.dwg Automation Error. Invalid input&lt;BR /&gt;Opening file : C:\Users\WE19171\Desktop\Trial\A2_DRG_SHT.dwg&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A2&lt;BR /&gt;C:\Users\User\Desktop\Trial\A2_DRG_SHT.dwg Automation Error. Invalid input&lt;BR /&gt;Opening file : C:\Users\WE19171\Desktop\Trial\A3P_DRG_SHT.dwg&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A3&lt;BR /&gt;Plot settings done for : A3 Sheet&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A3&lt;BR /&gt;Plot settings done for : Model&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;Opening file : C:\Users\User\Desktop\Trial\A3_DRG_SHT.dwg&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A3&lt;BR /&gt;Plot settings done for : A3 Sheet&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A3&lt;BR /&gt;Plot settings done for : Model&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;Opening file : C:\Users\User\Desktop\Trial\A4P_DRG_SHT.dwg&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A4&lt;BR /&gt;Plot settings done for : A4 Sheet&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A4&lt;BR /&gt;Plot settings done for : Model&lt;BR /&gt;--------------------------------------------------&lt;BR /&gt;Opening file : C:\Users\User\Desktop\Trial\A4_DRG_SHT.dwg&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A4&lt;BR /&gt;Plot settings done for : A4 Sheet&lt;BR /&gt;Searching in Model space for Title Block&lt;BR /&gt;Paper Size for Model Space : A4&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 06:23:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5895692#M137286</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-06T06:23:47Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5896033#M137287</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;Does the Adobe plotter has the paper size A1 &amp;amp; A2 ?&lt;/P&gt;
&lt;P&gt;It seems the code fails as it can't set the paper size.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please update your code to set the plot rotation, becuase right now plot rotation is setting two times.&lt;/P&gt;
&lt;P&gt;Based on the Papersize save the plot rotation to a variable and then set the rotation at the end.&lt;/P&gt;
&lt;P&gt;I have updated the code with the changes(in blue color).&lt;/P&gt;
&lt;P&gt;Please try with this and make sure the plotter has A2 and A1 size.&lt;/P&gt;
&lt;LI-SPOILER&gt;
&lt;PRE&gt;(defun c:RV ( / )
    (LM:ODBX
        (function
            (lambda ( doc )
  (princ (strcat "\nOpening file : "(vla-get-name doc)))
  (vlax-for lay (vla-get-layouts doc)
  
    (setq PaperSize "A2");-----default paper size
    &lt;FONT color="#0000FF"&gt;(setq PaperRotn "0");------default paper rotation&lt;/FONT&gt;
    (princ "\nSearching for Title Block")
    (vlax-for blk (vla-get-blocks doc)
    (cond
     (( = (vla-get-name blk) "A4L Drawing Sheet") (setq PaperSize "A4")&lt;FONT color="#0000FF"&gt;(setq PaperRotn "0")&lt;/FONT&gt;)
     (( = (vla-get-name blk) "A4 Drawing Sheet") (setq PaperSize "A4")&lt;FONT color="#0000FF"&gt;(setq PaperRotn "1")&lt;/FONT&gt;)
     (( = (vla-get-name blk) "A3 Drawing Sheet") (setq PaperSize "A3")&lt;FONT color="#0000FF"&gt;(setq PaperRotn "0")&lt;/FONT&gt;)
     (( = (vla-get-name blk) "A3P Drawing Sheet") (setq PaperSize "A3")&lt;FONT color="#0000FF"&gt;(setq PaperRotn "1")&lt;/FONT&gt;)
     (( = (vla-get-name blk) "A2 Drawing Sheet") (setq PaperSize "A2")&lt;FONT color="#0000FF"&gt;(setq PaperRotn "0")&lt;/FONT&gt;)
     (( = (vla-get-name blk) "A1 Drawing Sheet") (setq PaperSize "A1")&lt;FONT color="#0000FF"&gt;(setq PaperRotn "0")&lt;/FONT&gt;)
    );cond
    );vlax-for blocks
    (princ (strcat "\nSetting Paper Size : " PaperSize))

   (vla-put-ConfigName lay "Adobe PDF")  ;set the plotter
   (vla-put-CanonicalMediaName lay PaperSize) ;set the paper size
   (vla-put-PlotType lay "1")   ;plot area extens
   (vla-put-CenterPlot lay "1")   ;center plot
   (vla-put-PaperUnits lay "1")   ;set units to mm
   (vla-put-PlotWithLineweights lay "0")  ;turn off lineweights
   (vla-put-PlotWithPlotStyles lay "1")  ;turn on plot styles
   (vla-put-StandardScale lay "0")   ;fit to paper
   &lt;FONT color="#0000FF"&gt;(vla-put-PlotRotation lay PaperRotn)&lt;/FONT&gt;   ;Drawing orientation 1=portrait 0=landscape
   (vla-put-stylesheet lay "Grayscale.ctb") ;set  the CTB
   (princ (strcat "\nPlot settings done for : "(vla-get-name lay)))
  );vlax-for
  (princ "\n--------------------------------------------------")
            )
        )
        nil t
    )
    (princ)
);defun&lt;/PRE&gt;
&lt;/LI-SPOILER&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Nov 2015 11:54:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5896033#M137287</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-11-06T11:54:08Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5898524#M137288</link>
      <description>&lt;P&gt;Hi Ajilal,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yeah I checked to make sure the Adobe PDF printer had A1 and A2. I even went into the printer itself to make sure it was in there and everything checks out. When I 'RENAME' the A1 border to A3 it picks it up then and applys the A3 size to it. I just tested it on another PC with the Adobe PDF printer installed on it said it had the automation error on every drawing but it still applied the correct setting to the A3 and A4 borders so I'm feeling a bit stumped at the moment. I also tried renaming the normal A3 border to an A1 border and it never recognised it so I assume it's an issue with the printer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've checked and it looks like there's update for the Adobe Printer so now I'm just waiting on our IT group to investigate the updates and if they can apply them, hopefully that'll fix the issue. I'll let you know how it goes.&lt;/P&gt;&lt;P&gt;Cheers Ajilal.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 00:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5898524#M137288</guid>
      <dc:creator>joe_gio</dc:creator>
      <dc:date>2015-11-09T00:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to set plot setup</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5898636#M137289</link>
      <description>&lt;P&gt;Hi Joe,&lt;/P&gt;
&lt;P&gt;It seems that the exact name for A1 &amp;amp; A2 papersize in Adobe PDF is different.&lt;/P&gt;
&lt;P&gt;So can you try the below steps in a drawing and use that Paper size for Adobe PDF.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;In Modelspace or Papersize set the page setup manually by using Adobe PDF as plotter and A1 as paper size(ignore the other settings)&lt;/LI&gt;
&lt;LI&gt;Apply the settings to Layout.&lt;/LI&gt;
&lt;LI&gt;Then run the below code to get the exact name for the Papersize (copy the below line and paste to command line and hit Enter)&lt;/LI&gt;
&lt;LI&gt;&lt;FONT color="#0000FF"&gt;(vla-get-CanonicalMediaName (vla-get-activelayout (vla-get-ActiveDocument (vlax-get-acad-object))))&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;use the return value as the papersize in your code instead of A1.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Also repeat the above steps for A2.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Nov 2015 04:44:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-set-plot-setup/m-p/5898636#M137289</guid>
      <dc:creator>Ajilal.Vijayan</dc:creator>
      <dc:date>2015-11-09T04:44:50Z</dc:date>
    </item>
  </channel>
</rss>

