<?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>tema Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP en AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9991184#M1040242</link>
    <description>&lt;P&gt;Can I ask you a little modification?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is possible that this code would offset a line/polyline? For instance, I would define a factor, just like the code you've written, and then the lisp would ask the real distance to offset. Then, the offset woudl be given by the distance times the factor, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many many thanks and sorry to push my luck..&lt;/P&gt;</description>
    <pubDate>Sun, 10 Jan 2021 14:36:53 GMT</pubDate>
    <dc:creator>cool.stuff</dc:creator>
    <dc:date>2021-01-10T14:36:53Z</dc:date>
    <item>
      <title>Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984032#M1040011</link>
      <description>&lt;P&gt;Hi!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;New year community!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I've found this lisp:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;;Use this command to measure the distance between two points while applying a Combined Scale Factor&lt;BR /&gt;;Be sure to copy this lisp to your job folder, and set your CSF as required. Do not change CSF outside of job folder.&lt;BR /&gt;;Ahmed F. 2017&lt;BR /&gt;(defun c:DM ()&lt;BR /&gt;(setq TD 0)&lt;BR /&gt;(setq x1 (getpoint "\nSelect First Point: "))&lt;BR /&gt;(setq x2 (getpoint x1 "\nSelect Second Point: "))&lt;BR /&gt;(prompt&lt;BR /&gt;(strcat&lt;BR /&gt;(rtos (distance x1 x2))&lt;BR /&gt;(rtos (setq TD (+ TD (/(distance x1 x2) 0.12345))))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(prompt (strcat "\nTotal Distance = " (rtos TD)))&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;It measures a distance and divide it by the factor 0.12345.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I would like to know if anyone could help me and change the lisp to do the following things please:&lt;BR /&gt;- Asks for the factor and store it in a variable. Later, if the user wants, if could set the factor again (like the fillet radius);&lt;BR /&gt;- Add a text with the TD value, which would be placed in the 2nd point (it would be possible to define the text height, as the factor?);&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Many many thanks!!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 09:17:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984032#M1040011</guid>
      <dc:creator>cool.stuff</dc:creator>
      <dc:date>2021-01-07T09:17:17Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984141#M1040015</link>
      <description>&lt;P&gt;Not really sure why your code works with "total distance"... this not make sense to me.&lt;/P&gt;
&lt;P&gt;But try this code?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:TextDist (/ done p1 p2)
  
  (or *TD-Scale* (setq *TD-Scale* 1.))
  (or *TD-Height* (setq *TD-Height* 1.))
  
  (while (progn
	   (setq done nil)
	   (while (not done)
	     (princ (strcat "Current setting:  Scale " (rtos *TD-Scale*) "  Height " (rtos *TD-Height*)))
	     (initget "Scale Height")
	     (setq p1 (getpoint "\nSpecify a point or [Scale/Height]: "))
	     
	     (cond ((= p1 "Scale") 	(initget 3) (setq *TD-Scale* (getdist "\nScale factor: ")))
		   ((= p1 "Height") 	(initget 3) (setq *TD-Scale* (getdist "\nText height: ")))
		   ((setq done T))))
	   p1)
    
    (if (setq p2 (getpoint p1 "\nSecond point: "))
      (entmake (list (cons 0 "TEXT")
		     (cons 10 (trans p2 1 0))
		     (cons 7 (getvar 'textstyle))
		     (cons 40 *TD-Height*)
		     (cons 1 (rtos (/ (distance p1 p2) *TD-Scale*)))
		     (cons 50 (angle '(0 0 0) (getvar 'ucsxdir)))
		     ))))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 10:09:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984141#M1040015</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-01-07T10:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984180#M1040016</link>
      <description>&lt;P&gt;Works like a charm!!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many many thanks!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&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;&lt;P&gt;(please change this line to make the code run clear &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;		   ((= p1 "Height") 	(initget 3) (setq *TD-Height* (getdist "\nText height: "))&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;There is "TD-Scale" and it should be "TD-Height"!!!&amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 10:33:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984180#M1040016</guid>
      <dc:creator>cool.stuff</dc:creator>
      <dc:date>2021-01-07T10:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984227#M1040018</link>
      <description>&lt;P&gt;Ouch, thanks. Unfortunately, 30 min edit time has expired.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:TextDist (/ done p1 p2)
  
  (or *TD-Scale* (setq *TD-Scale* 1.))
  (or *TD-Height* (setq *TD-Height* 1.))
  
  (while (progn
	   (setq done nil)
	   (while (not done)
	     (princ (strcat "Current setting:  Scale " (rtos *TD-Scale*) "  Height " (rtos *TD-Height*)))
	     (initget "Scale Height")
	     (setq p1 (getpoint "\nSpecify a point or [Scale/Height]: "))
	     
	     (cond ((= p1 "Scale") 	(initget 3) (setq *TD-Scale* (getdist "\nScale factor: ")))
		   ((= p1 "Height") 	(initget 3) (setq *TD-Height* (getdist "\nText height: ")))
		   ((setq done T))))
	   p1)
    
    (if (setq p2 (getpoint p1 "\nSecond point: "))
      (entmake (list (cons 0 "TEXT")
		     (cons 10 (trans p2 1 0))
		     (cons 7 (getvar 'textstyle))
		     (cons 40 *TD-Height*)
		     (cons 1 (rtos (/ (distance p1 p2) *TD-Scale*)))
		     (cons 50 (angle '(0 0 0) (getvar 'ucsxdir)))
		     ))))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2021 11:04:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9984227#M1040018</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-01-07T11:04:38Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9991184#M1040242</link>
      <description>&lt;P&gt;Can I ask you a little modification?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It is possible that this code would offset a line/polyline? For instance, I would define a factor, just like the code you've written, and then the lisp would ask the real distance to offset. Then, the offset woudl be given by the distance times the factor, please?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many many thanks and sorry to push my luck..&lt;/P&gt;</description>
      <pubDate>Sun, 10 Jan 2021 14:36:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9991184#M1040242</guid>
      <dc:creator>cool.stuff</dc:creator>
      <dc:date>2021-01-10T14:36:53Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9992871#M1040263</link>
      <description>&lt;P&gt;Well, a bit confused by your saying "modification"... As I understand your task, you basically want another function that has nothing to do with the previous task but the scale factor. If I am right, try the following code. If not, elaborate on the issue more.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:FOffset (/ done flg osd)
  
  (or *TD-Scale* (setq *TD-Scale* 1.)) ;; set defaul value
  (or *FO-Dist*  (setq *FO-Dist* 1.))
  (setq osd (getvar 'offsetdist))
  
  (while (not done)
    (princ (strcat "Current settings:  Scale " (rtos *TD-Scale*)))
    (initget "Scale Through Erase Layer")
    (setq flg (getdist (strcat "\nSpecify offset distance or [Scale/Through/Erase/Layer] &amp;lt;" (rtos *FO-Dist*) "&amp;gt;: ")))
    (if (= flg "Scale")
      (progn
	(initget 3) (setq *TD-Scale* (getdist "\nScale factor: ")))
      (setq done T)))

  (if (numberp flg)
    (command "_.offset" (* (setq *FO-Dist* flg) *TD-Scale*))
    (progn
      (setvar 'offsetdist (* *FO-Dist* *TD-Scale*))
      (command "_.offset" flg)))
  (while (&amp;gt; (getvar 'cmdactive) 0) (command pause))
  (setvar 'offsetdist osd)
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Notes:&lt;/P&gt;
&lt;P&gt;- the scale factor would be the same for both routines.&amp;nbsp;*TD-Scale* (rename yourself if not)&lt;/P&gt;
&lt;P&gt;- &lt;FONT color="#FF0000"&gt;only from the first prompt&lt;/FONT&gt; &lt;EM&gt;Specify offset distance or [&lt;STRONG&gt;Scale&lt;/STRONG&gt;/Through/Erase/Layer]&lt;/EM&gt; you can specify &lt;STRONG&gt;a Scale&lt;/STRONG&gt;. If you pick any other option it will turn into the regular offset command (with distance already scaled). That means, if pick eg. "Layer" ... then after layer setting you will get back to "Specify offset distance or [Through/Erase/Layer] &amp;lt;20.000&amp;gt;:" prompt, now &lt;STRONG&gt;distance is already scaled&lt;/STRONG&gt; (both set and prompted).&lt;/P&gt;
&lt;P&gt;Good luck.&lt;/P&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: 380px; top: 972.108px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Jan 2021 12:44:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9992871#M1040263</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-01-11T12:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9992906#M1040265</link>
      <description>&lt;P&gt;Many many thanks!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'll test it later, but sounds great!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jan 2021 12:55:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9992906#M1040265</guid>
      <dc:creator>cool.stuff</dc:creator>
      <dc:date>2021-01-11T12:55:43Z</dc:date>
    </item>
    <item>
      <title>Re: Ask for distance and store it and add distance in text with a certain height  - Modify LISP</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9997954#M1040451</link>
      <description>&lt;P&gt;Many many thanks!!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Works perfectly!!! &lt;img class="lia-deferred-image lia-image-emoji" src="https://forums.autodesk.com/html/@38DF24EF580240D512020314976B5FC8/emoticons/1f642.png" alt=":cara_con_una_leve_sonrisa:" title=":cara_con_una_leve_sonrisa:" /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Jan 2021 09:19:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/ask-for-distance-and-store-it-and-add-distance-in-text-with-a/m-p/9997954#M1040451</guid>
      <dc:creator>cool.stuff</dc:creator>
      <dc:date>2021-01-13T09:19:22Z</dc:date>
    </item>
  </channel>
</rss>

