<?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: Setting and using the command measure as a variable in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488852#M19317</link>
    <description>&lt;P&gt;try this after you enter the Offset command at the command prompt:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(/(getdist"\nEnter Measurement To Be Divided By 2")2)&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 10 Jan 2024 16:43:56 GMT</pubDate>
    <dc:creator>paullimapa</dc:creator>
    <dc:date>2024-01-10T16:43:56Z</dc:date>
    <item>
      <title>Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488491#M19311</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am new to the Lisp feature in AutoCAD. but I was wondering how can I set a variable to equal the measure function between two lines.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then divide that variable in 2 and then create an offset of one of the lines at that distances or value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Example:&lt;BR /&gt;&lt;BR /&gt;take this value, devide it by 2&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgutierrezLK2GY_0-1704898124161.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1312578i4A2F54D50D21ECA1/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sgutierrezLK2GY_0-1704898124161.png" alt="sgutierrezLK2GY_0-1704898124161.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the new value set it as offset value and create an offset in the middle of both lines.&lt;/P&gt;&lt;P&gt;so the end result looks like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sgutierrezLK2GY_1-1704898214546.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1312579i67FDB0910A2FB91A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sgutierrezLK2GY_1-1704898214546.png" alt="sgutierrezLK2GY_1-1704898214546.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 14:50:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488491#M19311</guid>
      <dc:creator>sgutierrezLK2GY</dc:creator>
      <dc:date>2024-01-10T14:50:36Z</dc:date>
    </item>
    <item>
      <title>Betreff: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488500#M19312</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sorry to say, but my opinion is you have to learn the basics first.&lt;/P&gt;
&lt;P&gt;how to math, how to get data and then you can start with simple tasks.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-C64046FA-CD9E-4B38-9967-A501119E4A62" target="_blank" rel="noopener"&gt;https://help.autodesk.com/view/OARX/2024/ENU/?guid=GUID-C64046FA-CD9E-4B38-9967-A501119E4A62&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.afralisp.net/autolisp/tutorials/index.php?category_id=1" target="_blank" rel="noopener"&gt;https://www.afralisp.net/autolisp/tutorials/index.php?category_id=1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;SETQ GETPOINT GETDIST DISTANCE CAR ENTSEL and a lot more functions..&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;! For this goal, you don't need Lisp*, but you can use it..&lt;/P&gt;
&lt;P&gt;AND: You will find a lot of ready codes to offset to the half distance.&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;DIV id="simple-translate" class="simple-translate-system-theme"&gt;
&lt;DIV&gt;
&lt;DIV class="simple-translate-button isShow" style="background-image: url('moz-extension://bdcf6203-1d8d-4f0c-b98e-eba5f03789eb/icons/512.png'); height: 22px; width: 22px; top: 416px; left: -14px;"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="simple-translate-panel " style="width: 300px; height: 200px; top: 0px; left: 0px; font-size: 13px;"&gt;
&lt;DIV class="simple-translate-result-wrapper" style="overflow: hidden;"&gt;
&lt;DIV class="simple-translate-move" draggable="true"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV class="simple-translate-result-contents"&gt;
&lt;P class="simple-translate-result"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="simple-translate-candidate"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 10 Jan 2024 14:59:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488500#M19312</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2024-01-10T14:59:27Z</dc:date>
    </item>
    <item>
      <title>Betreff: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488509#M19313</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;then you are telling me that the solution is very simples. as long as you know the basics??&lt;BR /&gt;also thank you for the links, have been struggling to find these kind of information &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 15:00:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488509#M19313</guid>
      <dc:creator>sgutierrezLK2GY</dc:creator>
      <dc:date>2024-01-10T15:00:06Z</dc:date>
    </item>
    <item>
      <title>Re: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488531#M19314</link>
      <description>&lt;P&gt;Here's the motivation for you.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:midset ( / e p r)

  (if (and (setq e (entsel "\nSelect line to offset: "))
	   (setq p (vlax-curve-getclosestpointto (car e) (cadr e)))
	   (setq r (entsel "\nSelect reference line: "))
	   (setq r (vlax-curve-getclosestpointto (car r) (cadr r)))
	   (setvar 'offsetdist (/ (distance p r) 2))
	   )
    (command "_.offset" "" e "_non" r ""))
  (princ)
  )
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Agreed with&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;, learn a few basic functions and you can make wonders.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 15:06:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488531#M19314</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2024-01-10T15:06:07Z</dc:date>
    </item>
    <item>
      <title>Betreff: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488558#M19315</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/14883056"&gt;@sgutierrezLK2GY&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;&lt;EM&gt;then you are telling me that the solution is very simples. as long as you know the basics??&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;hmm. If you don't want a fully rebuilt of the native offset command, and if you just want to controle the native offset command, then yes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Without Lisp (or just using a simple &lt;FONT color="#999999"&gt;(&lt;/FONT&gt;command statement), you can create a macro like this:&lt;/P&gt;
&lt;P&gt;start COMMAND OFFSET&lt;/P&gt;
&lt;P&gt;use THROUGH option&lt;/P&gt;
&lt;P&gt;select the object to offset&lt;/P&gt;
&lt;P&gt;start object selection method m2p&lt;/P&gt;
&lt;P&gt;start object selection _nea&lt;/P&gt;
&lt;P&gt;use @ for the last point&lt;/P&gt;
&lt;P&gt;start object selection _per&lt;/P&gt;
&lt;P&gt;and select the other object&lt;/P&gt;
&lt;P&gt;exit offset command&lt;/P&gt;
&lt;P&gt;well done.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample: ^C^C^C_.OFFSET;_through;\_m2p;_nea;@;_per;\;&lt;/P&gt;
&lt;P&gt;sure, by Lisp you can do the same, a bit more "bullet proof"&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;EM&gt;also thank you for the links, have been struggling to find these kind of information&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/autocad/ct-p/8" target="_blank" rel="noopener"&gt;Here is the Lisp board (it's for questions about programming tips &amp;amp; tricks) : Click!&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 15:15:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488558#M19315</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2024-01-10T15:15:50Z</dc:date>
    </item>
    <item>
      <title>Re: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488667#M19316</link>
      <description>&lt;P&gt;For this simple procedure you can use the built in AutoCAD object snap M2P aka Mid Between 2 Points&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 15:49:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488667#M19316</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-01-10T15:49:31Z</dc:date>
    </item>
    <item>
      <title>Re: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488852#M19317</link>
      <description>&lt;P&gt;try this after you enter the Offset command at the command prompt:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(/(getdist"\nEnter Measurement To Be Divided By 2")2)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Jan 2024 16:43:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12488852#M19317</guid>
      <dc:creator>paullimapa</dc:creator>
      <dc:date>2024-01-10T16:43:56Z</dc:date>
    </item>
    <item>
      <title>Betreff: Setting and using the command measure as a variable</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12489093#M19318</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;.... AND: You will find a lot of ready codes to offset to the half distance.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There are whole topics on the subject, some with multiple approaches and variants, such as &lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-draw-line-between-two-lines-dividing-space-equally/td-p/6755183/highlight/true" target="_blank" rel="noopener"&gt;&amp;gt;this&amp;lt;&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Jan 2024 18:33:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/setting-and-using-the-command-measure-as-a-variable/m-p/12489093#M19318</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2024-01-10T18:33:43Z</dc:date>
    </item>
  </channel>
</rss>

