<?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: Add looping to this lisp in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512492#M39092</link>
    <description>&lt;P&gt;Thank you very much once again!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Yes I know about Publish &amp;amp; coffee. Publish was part of my routine at previous workplace. I remember even hitting 255 layout tab limit once, and then add +100 on another .dwg, someone should try to plot those one by one.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I actually was shocked to some extent at first that here we dont use layouts. Untill I realized that indeed they are not effective here. I think 10 pages has been my most pages on single .dwg and usually it is at lower end of 1-5 pages. Would you agree that layouts would be a bit waste of time here?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 27 Oct 2022 11:53:45 GMT</pubDate>
    <dc:creator>anton_chmidt</dc:creator>
    <dc:date>2022-10-27T11:53:45Z</dc:date>
    <item>
      <title>Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512263#M39088</link>
      <description>&lt;P&gt;Hello can someone please help me with this code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;This is lisp for plotting.&lt;BR /&gt;&lt;STRONG&gt;#1.&lt;/STRONG&gt; it ask user to select text object that contains filename for plotting pdf&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#2.&lt;/STRONG&gt; It ask to pick two opposite corners for plot window&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#3.&lt;/STRONG&gt; plot pdf.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question: Is it possible for it to loop &lt;STRONG&gt;#1&lt;/STRONG&gt;&amp;nbsp;and &lt;STRONG&gt;#2&lt;/STRONG&gt;&amp;nbsp;untill "T"-key is pressed after &lt;STRONG&gt;#2&lt;/STRONG&gt;, ending the loop and proceedeng to to &lt;STRONG&gt;#3&lt;/STRONG&gt; = plotting as many pdf´s as I have looped.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also I think it would be neccesary/awsome for it to check that user dont pick same name nor corners twice&lt;BR /&gt;&lt;BR /&gt;Currently working code:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(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] &amp;lt;No&amp;gt;:
           "" ; Enter a layout name or [?] &amp;lt;Model&amp;gt;:
           "DWG TO PDF.PC3" ; Enter an output device name or [?] &amp;lt;None&amp;gt;:
           "ISO full bleed A4 (210.00 X 297.00 mm)" ; Enter paper size or [?] &amp;lt;ISO A4 (210.00 x 297.00 MM)&amp;gt;:
           "Millimeters" ; Enter paper units [Inches/Millimeters] &amp;lt;Millimeters&amp;gt;:
           "Landscape" ; Enter drawing orientation [Portrait/Landscape] &amp;lt;Portrait&amp;gt;:
           "No" ; Plot upside down? [Yes/No] &amp;lt;No&amp;gt;:
           "Window" ; Enter plot area [Display/Extents/Limits/View/Window] &amp;lt;Display&amp;gt;:
			FirstCorner;
			SecondCorner;
           "Fit" ; Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] &amp;lt;Fit&amp;gt;:
           "Center" ; Enter plot offset (x,y) or [Center] &amp;lt;11.00,11.00&amp;gt;:
           "yes" ; Plot with plot styles? [Yes/No] &amp;lt;Yes&amp;gt;:
           "monochrome.ctb" ; Enter plot style table name or [?] (enter . for none) &amp;lt;&amp;gt;:
           "yes" ; Plot with lineweights? [Yes/No] &amp;lt;Yes&amp;gt;:
           "As displayed" ; Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] &amp;lt;As displayed&amp;gt;:
           (strcat (getvar 'DWGPREFIX) Filename ".pdf")
           "no" ; Save changes to page setup [Yes/No]? &amp;lt;N&amp;gt;
           "Yes" ; Proceed with plot [Yes/No] &amp;lt;Y&amp;gt;:
  )

)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 10:02:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512263#M39088</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2022-10-27T10:02:26Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512300#M39089</link>
      <description>&lt;P&gt;Just hit enter when you're done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:PlotLS (/ FirstCorner SecondCorner Filename l)
  
  (while (and (setq Filename (entsel "\nSelect filename &amp;lt;plot&amp;gt;: "))
	      (setq Filename (cdr (assoc 1 (entget (car 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
	      )
    (setq l (cons (list Filename FirstCorner SecondCorner) l)))
  
  (foreach e l
    (command "-plot"
	     "yes" ; Detailed plot configuration? [Yes/No] :
	     "" ; Enter a layout name or [?] :
	     "DWG TO PDF.PC3" ; Enter an output device name or [?] :
	     "ISO full bleed A4 (210.00 X 297.00 mm)" ; Enter paper size or [?] :
	     "Millimeters" ; Enter paper units [Inches/Millimeters] :
	     "Landscape" ; Enter drawing orientation [Portrait/Landscape] :
	     "No" ; Plot upside down? [Yes/No] :
	     "Window" ; Enter plot area [Display/Extents/Limits/View/Window] :
	     "_non" (cadr e);
	     "_non" (last e);
	     "Fit" ; Enter plot scale (Plotted Millimeters=Drawing Units) or [Fit] :
	     "Center" ; Enter plot offset (x,y) or [Center] &amp;lt;11.00,11.00&amp;gt;:
	     "yes" ; Plot with plot styles? [Yes/No] :
	     "monochrome.ctb" ; Enter plot style table name or [?] (enter . for none) &amp;lt;&amp;gt;:
	     "yes" ; Plot with lineweights? [Yes/No] :
	     "As displayed" ; Enter shade plot setting [As displayed/Wireframe/Hidden/Visual styles/Rendered] :
	     (strcat (getvar 'DWGPREFIX) (car e) ".pdf")
	     "no" ; Save changes to page setup [Yes/No]?
	     "Yes" ; Proceed with plot [Yes/No] :
	     ))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 18:07:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512300#M39089</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-10-27T18:07:54Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512325#M39090</link>
      <description>Just quick clarify, does this ask everything first and plot aftert, because the plotting itself is slow and I would rather pick everything and then go grab a coffee while it plots everything.&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 27 Oct 2022 10:33:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512325#M39090</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2022-10-27T10:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512348#M39091</link>
      <description>&lt;P&gt;Now it should. But you know what, normal people do a coffee break when PUBLISHing.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 10:47:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512348#M39091</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-10-27T10:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512492#M39092</link>
      <description>&lt;P&gt;Thank you very much once again!&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Yes I know about Publish &amp;amp; coffee. Publish was part of my routine at previous workplace. I remember even hitting 255 layout tab limit once, and then add +100 on another .dwg, someone should try to plot those one by one.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I actually was shocked to some extent at first that here we dont use layouts. Untill I realized that indeed they are not effective here. I think 10 pages has been my most pages on single .dwg and usually it is at lower end of 1-5 pages. Would you agree that layouts would be a bit waste of time here?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 11:53:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512492#M39092</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2022-10-27T11:53:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512606#M39093</link>
      <description>&lt;P&gt;Actually not working, it work exactly as original. I even tested creating new lisp just with your code and still asks and plot only one page as before. Neather am I pressing enter eather, after I click for second corner it plots and ends the lisp.&lt;BR /&gt;EDIT:&lt;BR /&gt;I should have mention before that plotting path is same as the dwg path + file name that comes from selected text object + .pdf&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 12:43:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11512606#M39093</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2022-10-27T12:43:39Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11513500#M39094</link>
      <description>&lt;P&gt;Of course, it does not... how could, if the was no loop func.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without knowing the circumstances am I in no position to recommend anything. Personally, I do layouts almost for everything.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Oct 2022 18:12:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11513500#M39094</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2022-10-27T18:12:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11769791#M39095</link>
      <description>&lt;P&gt;Hi again, this lisp has worked perfectly, it has helped so much on a daily basis, but now there is a risk that we wont store Filename like we used to. I am talking about filename from line:&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(while (and (setq Filename (entsel "\nSelect filename &amp;lt;plot&amp;gt;: "))&lt;/PRE&gt;&lt;P&gt;For now it is in&amp;nbsp; text object but in future it will possibly be in block attribute value. I am shocked by this change. So please tell me there is away to get filenames by selecting a blocks instead of text objects? The Attribute Tag is PIIR.NRO prompt is Piir.Nro and it is always on ninth row in Enchanced Attribute Editor. The block name/ id will be different and since you made this looping, user would point to multiple blocks in order to plot multiple files.&lt;BR /&gt;&lt;BR /&gt;If this is possible to do the best solution would be that if user pick text or mtext it would work as before, but if user pick block it would take Attribute value from PIIR.NRO. Is this possible and could you help me with this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 12:57:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11769791#M39095</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2023-02-21T12:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11769903#M39096</link>
      <description>&lt;P&gt;Is this attribute visible to select from a drawing? If so, you can just use &lt;EM&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;n&lt;/STRONG&gt;&lt;/FONT&gt;entsel&lt;/EM&gt; instead of &lt;EM&gt;entsel&lt;/EM&gt;, and you're good to go.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 13:22:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11769903#M39096</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-02-21T13:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11770062#M39097</link>
      <description>&lt;P&gt;It is visible. I will try it out tomorrow. Thanks. Will nensel work for both possibilities? I mean eather block attribute or text content? If not is I possible to male work for both?&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 14:16:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11770062#M39097</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2023-02-21T14:16:56Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11771496#M39098</link>
      <description>&lt;P&gt;Can you use layouts would make life easier as can do for me plot range it auto reads the layout name as the pdf name. I read you did comment about layouts.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is lots of pick point in model space enter scale make a layout with company title block. Mview matches picked point. For 10 layouts would be very fast.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like wise if must work in model set up a rectang block if no title block and read its size for the fit option again can do 10 in one go.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 00:00:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11771496#M39098</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-02-22T00:00:46Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11772105#M39099</link>
      <description>Perfect! Thank you so much!</description>
      <pubDate>Wed, 22 Feb 2023 07:58:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/11772105#M39099</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2023-02-22T07:58:50Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/12709010#M39100</link>
      <description>&lt;P&gt;Is it hard to add last selected filename as part of text entsel "\nSelect filename &amp;lt;plot&amp;gt;: "&lt;/P&gt;&lt;PRE&gt;Example: entsel "\n(Prev: Xxx01) Select next filename &amp;lt;plot&amp;gt;: "&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;Because sometimes when the list gets long there is a chance to mess up the selection. Would be nice to know which one was the last one already selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also the printing happens inverted from the back of the list, this is not critical since I just can now select the plots from the back but if this is super simple to fix ( invert the list) that would be nice&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 10:19:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/12709010#M39100</guid>
      <dc:creator>anton_chmidt</dc:creator>
      <dc:date>2024-04-15T10:19:43Z</dc:date>
    </item>
    <item>
      <title>Re: Add looping to this lisp</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/12709333#M39101</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2966365"&gt;@anton_chmidt&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;is super simple to fix ( invert the list) that would be nice&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;There is a function for that, just&amp;nbsp;&lt;EM&gt;Reverse&lt;/EM&gt; the list.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Apr 2024 12:38:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/add-looping-to-this-lisp/m-p/12709333#M39101</guid>
      <dc:creator>annoisscary</dc:creator>
      <dc:date>2024-04-15T12:38:16Z</dc:date>
    </item>
  </channel>
</rss>

