<?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: Modifying GetPoint Variable value in a loop in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11376271#M41915</link>
    <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1015195"&gt;@parutter&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have named your (getpoint) variable as startpoint.&lt;/P&gt;
&lt;P&gt;You just need to modify it with each increment of a.&lt;/P&gt;
&lt;P&gt;Let's say all your sheets (titleblocks?) are in a row, and the distance between lower left corners is always 10.&lt;/P&gt;
&lt;P&gt;Then each time after a plot (setq startpoint (polar startpoint 0.0 10)),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; like right after (setq a (1+ a))&lt;/P&gt;</description>
    <pubDate>Tue, 23 Aug 2022 17:03:40 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2022-08-23T17:03:40Z</dc:date>
    <item>
      <title>Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369257#M41906</link>
      <description>&lt;P&gt;I write AutoLisp scripts poorly at best, but I have created a function called csplot (cut sheet plot) that allows me to make multiple PDFs from 1 Paper Space Tab. I designate the number of sheets, click the bottom left corner of the 8.5x11 borders and send the specified number of PDFs to a specific location where I combine them into 1 PDF.&lt;/P&gt;&lt;P&gt;I know using individual tabs would solve the problem through Plot/Publish, but it isn't practical because of the volume of these individual sheets we make (it's hundreds throughout the project).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I Always space my sheets the same in these viewports, and I realized that if I know how many sheets I'm making, I can automate the window selection process for the plots based on the first border I click. How do I modify the location of a variable with the Getpoint info?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I attempted googling the answer, but I'm not familiar enough with the AutoLisp Terms to find what I'm looking for.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the function as it is. I intend on starting the loop after the getpoint, but I felt context would be helpful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;;CSPLOT.lsp&lt;/P&gt;&lt;P&gt;(&lt;BR /&gt;defun C:csplot ()&lt;BR /&gt;(command "FILEDIA")&lt;BR /&gt;(command "0")&lt;BR /&gt;(setq a 1)&lt;BR /&gt;(setq times (getint "\nEnter Number of Sheets: "))&lt;BR /&gt;(while (&amp;lt;= a times)&lt;BR /&gt;(setq startpoint (getpoint "Click on bottom left corner of 8.5 x 11 border"))&lt;BR /&gt;(setq str2 (itoa a))&lt;BR /&gt;(setq str (strcat "C:\\CSPLOT\\" str2 ".pdf"))&lt;BR /&gt;(command "-PLOT")&lt;BR /&gt;(command "YES")&lt;BR /&gt;(command " ")&lt;BR /&gt;(command "DWG TO PDF.PC3")&lt;BR /&gt;(command "LETTER")&lt;BR /&gt;(command "inches")&lt;BR /&gt;(command "PORTRAIT")&lt;BR /&gt;(command "NO")&lt;BR /&gt;(command "WINDOW")&lt;BR /&gt;(command startpoint)&lt;BR /&gt;(command "@8,10.2")&lt;BR /&gt;(command "1:1")&lt;BR /&gt;(command "CENTER")&lt;BR /&gt;(command "yes")&lt;BR /&gt;(command "W2K_LJ5")&lt;BR /&gt;(command "YES")&lt;BR /&gt;(command "YES")&lt;BR /&gt;(command "NO")&lt;BR /&gt;(command "NO")&lt;BR /&gt;(command str)&lt;BR /&gt;(command "N")&lt;BR /&gt;(command "Y")&lt;BR /&gt;(princ)&lt;BR /&gt;(princ)&lt;BR /&gt;(setq a (1+ a))&lt;BR /&gt;(princ)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;(command "FILEDIA")&lt;BR /&gt;(command "1")&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 15:39:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369257#M41906</guid>
      <dc:creator>parutter</dc:creator>
      <dc:date>2022-08-19T15:39:31Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369337#M41907</link>
      <description>&lt;P&gt;If the 8.5x11 borders are actually blocks then you can use the lisp code &lt;A title="Plot Title Blocks" href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-plot-to-pdf-in-model-space/m-p/6213711" target="_blank" rel="noopener"&gt;here&lt;/A&gt; to generate your plots of all the title blocks in the current layout&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 16:21:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369337#M41907</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-08-19T16:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369591#M41908</link>
      <description>&lt;P&gt;If you have a common titleblock, you could use the bounding box property to automate this more.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 18:09:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369591#M41908</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2022-08-19T18:09:01Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369613#M41909</link>
      <description>&lt;P&gt;I was trying to read through the code but without running it, I wasn't able to identify where it was selecting objects.&amp;nbsp; My sheets are identical block names, where is the object selection in this code?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 18:19:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369613#M41909</guid>
      <dc:creator>parutter</dc:creator>
      <dc:date>2022-08-19T18:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369621#M41910</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1015195"&gt;@parutter&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I was trying to read through the code but without running it, I wasn't able to identify where it was selecting objects.&amp;nbsp; My sheets are identical block names, where is the object selection in this code?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir="ltr"&gt;No object selection in that code. Post a sample drawing of what you're trying to plot.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 18:22:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369621#M41910</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2022-08-19T18:22:10Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369787#M41911</link>
      <description>&lt;P&gt;I appreciate any help.&amp;nbsp; Please see the attached. It is a stripped down version of our file, most of the information is gone but the viewports / borders are in the CS-Drain Tab&lt;/P&gt;</description>
      <pubDate>Fri, 19 Aug 2022 20:04:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369787#M41911</guid>
      <dc:creator>parutter</dc:creator>
      <dc:date>2022-08-19T20:04:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369807#M41912</link>
      <description>&lt;P&gt;We don't even need to use the bounding box, we can just ad the width and the height to the basepoint since it's in the lower left corner.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See if you can add your plot parameters to this snippet:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:foo (/ fn n p1 p2 s)
  (cond	((setq s (ssget '((0 . "INSERT") (2 . "8X11SS-newlogo"))))
	 (setq n 0)
	 (setq fn (strcat (getvar 'dwgprefix) (getvar 'ctab)))
	 (foreach e (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))
	   (setq p1 (cdr (assoc 10 (entget e))))
	   (setq p2 (mapcar '+ p1 '(8 10.2 0)))
	   (grdraw p1 p2 1)
	   ;; You'll need to modify this for your plot settings ( I took a first stab )
	   (command "-plot"
		    "yes"
		    (getvar 'ctab)
		    "DWG TO PDF.PC3"
		    "Letter"
		    "Inches"
		    "Portrait"
		    "No"
		    "Window"
		    p1
		    p2
		    "1:1"
		    "Center"
		    "Yes"
		    "W2K_LJ5.ctb"
		    "Yes"
		    "Yes"
		    "No"
		    "No"
		    (strcat fn "-" (itoa (setq n (1+ n))) ".pdf")
		    "No"
		    "Yes"
	   )
	 )
	)
  )
  (princ)
)&lt;/LI-CODE&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>Fri, 19 Aug 2022 20:36:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369807#M41912</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2022-08-19T20:36:23Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369962#M41913</link>
      <description>&lt;P&gt;The code below is modified from the post I had given you earlier.&lt;/P&gt;&lt;P&gt;This also sorts the title blocks to plot from left to right first and then bottom to top&lt;/P&gt;&lt;LI-CODE lang="general"&gt;; csplot plots area within all blocks: 8X11SS-newlogo in current layout
; modified from Henrique Moreira da Silva's code;
; https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/batch-plot-to-pdf-in-model-space/m-p/6213711
(defun c:csplot (/ bas dwg file hnd i len llpt lst mn mx ss tab urpt)
(vl-load-com)
    (if (setq ss (ssget "_X" '((0 . "INSERT") (2 . "8X11SS-newlogo")))) ; automatically select all
;     (if (setq ss (ssget (list (cons 0 "INSERT") (cons 2 "8X11SS-newlogo")))) ; if want to manually select
        (progn
            (repeat (setq i (sslength ss))
                (setq hnd (ssname ss (setq i (1- i)))
                      tab (cdr (assoc 410 (entget hnd)))
                      bas (cdr (assoc 10 (entget hnd))) ; get insert base point
                )
                (if (equal tab (getvar"ctab")) ; if ttl blk is in current layout
                    (setq lst (cons (cons tab (cons bas hnd)) lst)) ; add to lst for plotting
                )
            )
            ; sort by blocks insert base point left to right and bottom to top
            ; https://www.cadtutor.net/forum/topic/71201-function-to-sort-a-list-of-points-first-x-then-y/
            (setq lst 
             (vl-sort lst 
             '(lambda (x y) 
               (if (= (car (cadr x)) (car(cadr y))) 
                (&amp;lt; (car (cadr x)) (car (cadr y)))
                (&amp;lt; (cadr (cadr x)) (cadr (cadr y))) 
               )
              )
             )
            )

            (setq i 0)
            (foreach x lst
                (setq file (strcat "C:\\CSPLOT\\"  ; (getvar 'DWGPREFIX)
                                   (substr (setq dwg (getvar 'DWGNAME)) 1 (- (strlen dwg) 4))
                                   "-"
                                   (itoa (setq i (1+ i)))
                                   ".pdf"
                           )
                )
                (if (findfile file)
                    (vl-file-delete file)
                )
;                (vla-getboundingbox (vlax-ename-&amp;gt;vla-object (cddr x)) 'mn 'mx)
;                (setq llpt (vlax-safearray-&amp;gt;list mn)
;                      urpt (vlax-safearray-&amp;gt;list mx)
;                      len  (distance llpt (list (car urpt) (cadr llpt)))
;                )
                (setq llpt (cdr(assoc 10(entget (cddr x))))) 
                (setq urpt (list (+ 8.0 (car llpt)) (+ 10.25 (cadr llpt))))  ; use exact dimension for 8.5 x 11.0 ttl blk
                (command "-plot"
                         "yes"
                         (car x)
                         "DWG TO PDF.PC3"
                         "ANSI full bleed A (8.50 x 11.00 Inches)"
                         "inches"
                         "Portrait"
                         "No"
                         "Window"
                         llpt
                         urpt
                         "1:1"
                         "Center"
                         "yes"
                         "W2K_LJ5.ctb"
                         "yes"
                         ""
                )
                (if (/= (car x) "Model")
                    (command "No" "No" file "no" "Yes")
                    (command
                        file
                        "no"
                        "Yes"
                    )
                )
            )
        )
    )
    (princ)
) ; defun&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 19 Aug 2022 22:42:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11369962#M41913</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2022-08-19T22:42:34Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11374766#M41914</link>
      <description>&lt;P&gt;If you make a list of each pdf name as you go you can via lisp use Ghostscript to join all the pdfs back into 1 pdf.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;;MergePdfs
;Merges multiple pdf (or eps) files into one
;Requires the installation of Ghostscript 

; make a batch file ?
;gs -sDEVICE=pdfwrite \
;    -dNOPAUSE -dBATCH -dSAFER \
;    -sOutputFile=combined.pdf \
;    first.pdf \
;    second.pdf \
;    third.pdf [...]

;Ghostscript (http://www.ghostscript.com/) can be used to combine PDFs.

; Something like this should work: by Roy_043

(defun KGA_String_Join (strLst delim)
(if strLst
(apply
'strcat
(cons
(car strLst)
(mapcar '(lambda (a) (strcat delim a)) (cdr strLst))
)
)
""
)
)

; (CombinePdf 
;  (setq gsexe "C:\\Program Files\\gs\\gs9.19\\bin\\gswin64c.exe")
(setq gsexe "P:\\gs\\gs9.19\\bin\\gswin64c.exe")
; (setq srcFilelst  '("D:\\Tmp\\A.pdf" "D:\\Tmp\\B.pdf"))
; (setq trgfile "C:\\Acadtemp\\Total.pdf")
; )
; Note: Existing trgFile will be overwritten.
(defun CombinePdf (gsExe srcFileLst trgFile)
(startapp 
(strcat
gsExe " "
"-sDEVICE=pdfwrite -dBATCH -dNOPAUSE -dQUIET  "
"-sOutputFile=\"" trgFile "\" "
"\"" (KGA_String_Join srcFileLst "\" \"") "\""
)
)
)

&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 23 Aug 2022 05:19:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11374766#M41914</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2022-08-23T05:19:12Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11376271#M41915</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1015195"&gt;@parutter&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You have named your (getpoint) variable as startpoint.&lt;/P&gt;
&lt;P&gt;You just need to modify it with each increment of a.&lt;/P&gt;
&lt;P&gt;Let's say all your sheets (titleblocks?) are in a row, and the distance between lower left corners is always 10.&lt;/P&gt;
&lt;P&gt;Then each time after a plot (setq startpoint (polar startpoint 0.0 10)),&lt;/P&gt;
&lt;P&gt;&amp;nbsp; like right after (setq a (1+ a))&lt;/P&gt;</description>
      <pubDate>Tue, 23 Aug 2022 17:03:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11376271#M41915</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2022-08-23T17:03:40Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11602018#M41916</link>
      <description>&lt;P&gt;Thank you all so much for all of the help. I apologize for the considerable delay, but all of you have certainly helped expand my minimal knowledge of AutoLISP!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 18:58:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11602018#M41916</guid>
      <dc:creator>parutter</dc:creator>
      <dc:date>2022-12-06T18:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: Modifying GetPoint Variable value in a loop</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11602027#M41917</link>
      <description>&lt;P&gt;This is some icing on the cake, for Sure!&lt;/P&gt;</description>
      <pubDate>Tue, 06 Dec 2022 19:00:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/modifying-getpoint-variable-value-in-a-loop/m-p/11602027#M41917</guid>
      <dc:creator>parutter</dc:creator>
      <dc:date>2022-12-06T19:00:35Z</dc:date>
    </item>
  </channel>
</rss>

