<?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: Creating/Appending a Dimension through LISP in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976876#M85213</link>
    <description>&lt;P&gt;&lt;STRIKE&gt;Well, that seems to fix the first issue.&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;&lt;STRIKE&gt;Oddly enough, now I'm getting an error about invalid selection expecting single object after selecting holes, though nothing has changed for that piece of code.&amp;nbsp;&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scratch that, it only doesn't work with AMPOWERDIM_DIA. Using DIMDIAMETER works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help, both of you.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Aug 2019 20:13:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-08-20T20:13:05Z</dc:date>
    <item>
      <title>Creating/Appending a Dimension through LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976713#M85210</link>
      <description>&lt;P&gt;I've got the following bit of code and I can't seem to figure out why it won't create the dimension object.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:DIMDIA (/ pr cl osm obj rad ep sp ss count newdim d ) 
	(setvar "cmdecho" 0)										;Variables
	(setq pr (getvar "luprec"))
	(setq cl (getvar "clayer"))
	(setq osm (getvar "osmode"))
	(setvar "osmode" 0)
	(if (= (getvar "lunits") 2) (setvar "luprec" 3))
	(setq obj (vlax-ename-&amp;gt;vla-object (setq e (car (entsel "\nSelect circle to Dimension: ")))))
	(if (= (vla-get-objectname obj) "AcDbCircle")
		(progn	
			(setq rad (vla-get-radius obj))&lt;BR /&gt;                        (setq f (getpoint "\nLeader Location: "))
			(command "LAYER" "M" "DIM" "")
			(command "AMPOWERDIM_DIA" e f )
			(princ "\nSelect Circles for hole count")
			(setq ss (ssget (list '(0 . "CIRCLE")(cons 40 rad))))
			(if (/= (setq count (sslength ss)) 0)
				(progn
					(setq newdim (entlast))
					(setq d (strcat "&amp;lt;&amp;gt;" "[]" " (" (itoa count) " PLACES)"))
					(command "dimedit" "n" d newdim  "")
				)
			)
		)
		(princ "\nSelected Object is not a circle.")
	)
	(setvar "clayer" cl)
	(setvar "luprec" pr)
	(setvar "osmode" osm)
	(princ)
)	&lt;/PRE&gt;&lt;P&gt;It seems to completely skip over the (command "AMPOWERDIM_DIA" e f ) portion of code, while the rest of it executes flawlessly, instead altering the previously placed dimension.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, would there be a way to show the preview of the dimension location before its placed? I tried nesting the (getpoint) within the "AMPOWERDIM_DIA" command, but no such luck, though that might be tied to the first issue.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 18:44:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976713#M85210</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-20T18:44:13Z</dc:date>
    </item>
    <item>
      <title>Re: Creating/Appending a Dimension through LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976734#M85211</link>
      <description>&lt;P&gt;I don't have AutoCAD Mechanical but if you want to see the placement of the dimension try this:&lt;/P&gt;&lt;PRE&gt;(command "AMPOWERDIM_DIA" e &lt;STRONG&gt;"\\"&lt;/STRONG&gt; )&lt;/PRE&gt;&lt;P&gt;And comment out:&lt;/P&gt;&lt;PRE&gt;(setq f (getpoint "\nLeader Location: "))&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Aug 2019 18:57:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976734#M85211</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2019-08-20T18:57:57Z</dc:date>
    </item>
    <item>
      <title>Re: Creating/Appending a Dimension through LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976813#M85212</link>
      <description>&lt;P&gt;Try with this change....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:DIMDIA (/ pr cl osm obj rad ep sp ss count newdim d ) 
	(setvar "cmdecho" 0)										;Variables
	(setq pr (getvar "luprec"))
	(setq cl (getvar "clayer"))
	(setq osm (getvar "osmode"))
	(setvar "osmode" 0)
	(if (= (getvar "lunits") 2) (setvar "luprec" 3))
	(setq obj (vlax-ename-&amp;gt;vla-object (car &lt;FONT color="#0000FF"&gt;(setq e&lt;/FONT&gt; (entsel "\nSelect circle to Dimension: ")))))
	(if (= (vla-get-objectname obj) "AcDbCircle")
		(progn	
			(setq rad (vla-get-radius obj))
                        (setq f (getpoint "\nLeader Location: "))
			(command "LAYER" "M" "DIM" "")
			;(command "AMPOWERDIM_DIA" e f )
			&lt;FONT color="#0000FF"&gt;(command "AMPOWERDIM_DIA" (cadr e))&lt;/FONT&gt;
			&lt;FONT color="#008000"&gt;;(command "DIMDIAMETER" (cadr e));;; Or Try this&lt;/FONT&gt;
			&lt;FONT color="#0000FF"&gt;(while (/= (getvar "cmdactive") 0)(command f))&lt;/FONT&gt;
			(princ "\nSelect Circles for hole count")
			(setq ss (ssget (list '(0 . "CIRCLE")(cons 40 rad))))
			(if (/= (setq count (sslength ss)) 0)
				(progn
					(setq newdim (entlast))
					(setq d (strcat "&amp;lt;&amp;gt;" "[]" " (" (itoa count) " PLACES)"))
					(command "dimedit" "n" d newdim  "")
				)
			)
		)
		(princ "\nSelected Object is not a circle.")
	)
	(setvar "clayer" cl)
	(setvar "luprec" pr)
	(setvar "osmode" osm)
	(princ)
)&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Aug 2019 19:44:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976813#M85212</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2019-08-20T19:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: Creating/Appending a Dimension through LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976876#M85213</link>
      <description>&lt;P&gt;&lt;STRIKE&gt;Well, that seems to fix the first issue.&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;&lt;STRIKE&gt;Oddly enough, now I'm getting an error about invalid selection expecting single object after selecting holes, though nothing has changed for that piece of code.&amp;nbsp;&lt;/STRIKE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scratch that, it only doesn't work with AMPOWERDIM_DIA. Using DIMDIAMETER works fine.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help, both of you.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2019 20:13:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976876#M85213</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-08-20T20:13:05Z</dc:date>
    </item>
    <item>
      <title>Re: Creating/Appending a Dimension through LISP</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976916#M85214</link>
      <description>&lt;P&gt;You Welcome &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;</description>
      <pubDate>Tue, 20 Aug 2019 20:23:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/creating-appending-a-dimension-through-lisp/m-p/8976916#M85214</guid>
      <dc:creator>dbhunia</dc:creator>
      <dc:date>2019-08-20T20:23:24Z</dc:date>
    </item>
  </channel>
</rss>

