<?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 adjustments in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6768201#M125395</link>
    <description>&lt;P&gt;Hi, if we helped - please mark our posts as a solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To achieve what you want there is no need use any lisp.&lt;/P&gt;&lt;P&gt;You can do it by yourself.&lt;/P&gt;&lt;P&gt;Just defining block with fileds in attributes - even better solution than this with mtext description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look at this thread (but offcourse change X,Y coordinates and leave Z in this case).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cad-notes.com/how-to-label-coordinate-in-autocad/" target="_blank"&gt;http://www.cad-notes.com/how-to-label-coordinate-in-autocad/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It isn't hard to change&amp;nbsp;this lisp but I think it will be better for you if you will try to do it by yourself and learn something new.&lt;/P&gt;&lt;P&gt;Merry Christmas.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
    <pubDate>Fri, 23 Dec 2016 20:37:53 GMT</pubDate>
    <dc:creator>krzysztof.psujek</dc:creator>
    <dc:date>2016-12-23T20:37:53Z</dc:date>
    <item>
      <title>Lisp adjustments</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6766654#M125391</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I found this fine lsp that allows me to annotate elevation and insert a point at random pick points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been using it for a couple of weeks now and I noticed a couple of things that I would like to modify.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, how can I make this routine ask me, at the beginning, for the text height I want to use ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Second, when I annotate random pick points, a point and an annotation is added for the elevation, but the annotation is only "###" until I exit the command. What is the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, I know there is a way to use a comma as decimal separator &lt;SPAN&gt;(vl-string-subst "," ".") but I don't know where to insert it in the code.&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;Thank you for taking the time to help me !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun C:zlb (/ acsp adoc mtx pt str util)
  (vl-load-com)
  (or adoc
      (setq adoc
	     (vla-get-activedocument
	       (vlax-get-acad-object)
	     )
      )
  )
  (if (and
	(= (getvar "tilemode") 0)
	(= (getvar "cvport") 1)
      )
    (setq acsp (vla-get-paperspace adoc))
    (setq acsp (vla-get-modelspace adoc))
  )
  (or util
      (setq util
	     (vla-get-utility adoc)
      )
  )

  (setvar "fieldeval" 31)			  ;to update field in all cases
  (setvar "fielddisplay" 0)			  ;without grey mask
  (setvar "pdsize" 0.1)				  ;point size, change by suit
  (setvar "pdmode" 34)				  ;point mode, change by suit  
  (while
    (or	(vla-initializeuserinput util 0 " ")
	(not
	  (vl-catch-all-error-p
	    (setq
	      pt (vl-catch-all-apply
		   (function
		     (lambda ()
		       (vla-getpoint
			 util
			 nil
			 "\nSpecify point (Or press Enter to exit) &amp;gt;&amp;gt;"
		       )
		     )
		   )
		 )
	    )
	  )
	)
    )
     (if pt
       (progn
	 (vla-addpoint acsp pt)
	 (setq mtx (vla-addmtext acsp pt 0.0 "###")) ;any string
         ;; architectural units : 
;;;	 (setq str
;;;		(strcat
;;;		  "%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
;;;		  (itoa
;;;		    (vla-get-objectid
;;;		      mtx
;;;		    )
;;;		  )
;;;		  "&amp;gt;%).InsertionPoint \\f \"%lu4%pt4\"&amp;gt;%"
;;;		)
;;;	 )
	 ;; decimal units : 
	 (setq str
		(strcat
		  "%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "
		  (itoa
		    (vla-get-objectid
		      mtx
		    )
		  )
		  "&amp;gt;%).InsertionPoint \\f \"%lu2%pt4\"&amp;gt;%"
		)
	 )
	 (vla-put-textstring mtx str)
	 (vla-update mtx)
       )
     )
  )
  (vla-regen adoc acactiveviewport)
  (vl-catch-all-apply
    (function (lambda ()
		(vlax-release-object mtx)
	      )
    )
  )
  (princ)
)
(prompt "\n")
(prompt "\n\t###\tType ZLB to run point labeling\t###\n")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 22:04:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6766654#M125391</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2016-12-22T22:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp adjustments</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6766780#M125392</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;1. mtext created by routine uses system variable &lt;A href="https://knowledge.autodesk.com/support/autocad/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/AutoCAD-Core/files/GUID-DD548317-95BA-4AEA-B54D-0D917F10D3C1-htm.html" target="_self"&gt;TEXTSIZE&lt;/A&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;to set its size,&lt;/P&gt;&lt;P&gt;just change it before run lisp and you will get what you want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;add for example sth like this before setvars:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;...&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;(if (setq txtsize (getreal "\nEnter text heigth: "))
    (setvar 'textsize txtsize)
    )&lt;/FONT&gt; &lt;BR /&gt;&lt;BR /&gt; (setvar "fieldeval" 31) ;to update field in all cases&lt;BR /&gt; (setvar "fielddisplay" 0) ;without grey mask&lt;BR /&gt; (setvar "pdsize" 0.1) ;point size, change by suit&lt;BR /&gt; (setvar "pdmode" 34) &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;change also first line to&lt;/P&gt;&lt;PRE&gt;(defun C:zlb (/ acsp adoc mtx pt str util &lt;FONT color="#FF0000"&gt;txtsize&lt;/FONT&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2.&amp;nbsp;&lt;SPAN&gt;"###" it appears at the begining when mtext is created follow with the comment temporary any string&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;which is updated (replaced with FIELD)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(setq mtx (vla-addmtext acsp pt 0.0 "###")) ;any string&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;3.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Dec 2016 23:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6766780#M125392</guid>
      <dc:creator>krzysztof.psujek</dc:creator>
      <dc:date>2016-12-22T23:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp adjustments</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6767217#M125393</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3164629"&gt;@JB-T&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
...
&lt;P&gt;Finally, I know there is a way to use a comma as decimal separator &lt;SPAN&gt;(vl-string-subst "," ".") but I don't know where to insert it in the code.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
...&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Can't use this method.&amp;nbsp;You need to set correct field format &amp;gt;&amp;gt; see the screenshot.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change&lt;/P&gt;
&lt;P&gt;"&amp;gt;%).InsertionPoint \\f \"%lu2%pt4\"&amp;gt;%"&lt;/P&gt;
&lt;P&gt;to&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"&amp;gt;%).InsertionPoint \\f \"%lu2%pt4&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;%ds44&lt;/STRONG&gt;&lt;/FONT&gt;\"&amp;gt;%"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 09:29:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6767217#M125393</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-12-23T09:29:34Z</dc:date>
    </item>
    <item>
      <title>Re : Lisp adjustments</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6767463#M125394</link>
      <description>&lt;P&gt;Thank you both for your answers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It fixed&amp;nbsp;the text height and the decimal separator issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would it be possible to modify something in the routine in order to have the elevation displayed immediately instead of "###".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you again !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;JB&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 13:19:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6767463#M125394</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2016-12-23T13:19:39Z</dc:date>
    </item>
    <item>
      <title>Re : Lisp adjustments</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6768201#M125395</link>
      <description>&lt;P&gt;Hi, if we helped - please mark our posts as a solutions.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To achieve what you want there is no need use any lisp.&lt;/P&gt;&lt;P&gt;You can do it by yourself.&lt;/P&gt;&lt;P&gt;Just defining block with fileds in attributes - even better solution than this with mtext description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take a look at this thread (but offcourse change X,Y coordinates and leave Z in this case).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.cad-notes.com/how-to-label-coordinate-in-autocad/" target="_blank"&gt;http://www.cad-notes.com/how-to-label-coordinate-in-autocad/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It isn't hard to change&amp;nbsp;this lisp but I think it will be better for you if you will try to do it by yourself and learn something new.&lt;/P&gt;&lt;P&gt;Merry Christmas.&lt;/P&gt;&lt;P&gt;Chris&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 20:37:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-adjustments/m-p/6768201#M125395</guid>
      <dc:creator>krzysztof.psujek</dc:creator>
      <dc:date>2016-12-23T20:37:53Z</dc:date>
    </item>
  </channel>
</rss>

