<?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: Passing variable as relative in COMMAND function in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7543558#M112180</link>
    <description>This is all getting stupid.  What matters more, the looks of the code or&lt;BR /&gt;the results of the code?&lt;BR /&gt;p1 and p2 give you results.</description>
    <pubDate>Tue, 14 Nov 2017 17:24:23 GMT</pubDate>
    <dc:creator>john.uhden</dc:creator>
    <dc:date>2017-11-14T17:24:23Z</dc:date>
    <item>
      <title>Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537301#M112170</link>
      <description>&lt;P&gt;Is there a way to pass a variable as relative into for example a rectang function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is part of my code and it doesnt work&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;        (setq p1 ip)
	(setq p2 ( list o_width o_height 0))
	(command "_rectang"
			
		p1
		
		@p2  ; how to pass p2 as relative? this doesnt work
		
		""
	)&lt;/PRE&gt;&lt;P&gt;How i cand&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2017 15:02:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537301#M112170</guid>
      <dc:creator>126843</dc:creator>
      <dc:date>2017-11-12T15:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537651#M112171</link>
      <description>&lt;P&gt;You can calculate p2 coordinates before the "rectang" command and pass p2 to that command as absolute instead of relative.:&lt;/P&gt;&lt;PRE&gt;(setq p1 ip )
(setq p2 ( list (+ (car p1) o_width) (+ (cadr p1) o_height) 0))
(command "_rectang" p1 p2 )&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Nov 2017 21:50:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537651#M112171</guid>
      <dc:creator>andkal</dc:creator>
      <dc:date>2017-11-12T21:50:39Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537710#M112172</link>
      <description>&lt;P&gt;or...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq p2 (mapcar '+ p1 (list o_width o_height 0)))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Plus, if there happen to be running object snaps (to avoid)...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(command "_rectang" "_non" p1 "_non" p2)&lt;/PRE&gt;</description>
      <pubDate>Sun, 12 Nov 2017 22:42:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537710#M112172</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-12T22:42:17Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537736#M112173</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;Another possible approach, without the need for the p2 variable&amp;nbsp;[untested]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        (setq p1 ip)
	(command "_rectang"
		p1		
		(strcat "@" (rtos o_width) "," (rtos o_height) ",0")
	)
	&lt;/PRE&gt;
&amp;nbsp;
&lt;P class="1510528878347"&gt;The ""&amp;nbsp;in yours is extraneous, by the way -- giving the second corner of the rectangle completes the RECTANG command.&amp;nbsp;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 12 Nov 2017 23:22:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537736#M112173</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-12T23:22:28Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537782#M112174</link>
      <description>That's the cleverness we can always expect from you.  Just one question...&lt;BR /&gt;Might you want to specify the precision?  Oops, make that two questions...&lt;BR /&gt;might (rtos value 2 8) be not precise enough, as in what if the user is&lt;BR /&gt;dealing with fractions of angstroms, but the units are meters?  I am&lt;BR /&gt;implying that in some cases it may be better to pass reals than approximate&lt;BR /&gt;reals.  Of course if the purpose is only to specify a box for mtext, then&lt;BR /&gt;precision should rarely matter.</description>
      <pubDate>Mon, 13 Nov 2017 00:26:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537782#M112174</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-13T00:26:23Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537967#M112175</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;Another possible approach, without the need for the p2 variable&amp;nbsp;[untested]:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;        (setq p1 ip)
	(command "_rectang"
		p1		
		(strcat "@" (rtos o_width) "," (rtos o_height) ",0")
	)
&lt;/PRE&gt;
&amp;nbsp;...&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Come to think of it, you don't need the p1 variable either:&lt;/P&gt;
&lt;P&gt;(command "_rectang"&lt;BR /&gt;&amp;nbsp; &lt;STRONG&gt;ip&lt;/STRONG&gt;&lt;BR /&gt;&amp;nbsp; (strcat "@" (rtos o_width) "," (rtos o_height) ",0")&lt;BR /&gt; )&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 03:12:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7537967#M112175</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-13T03:12:04Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540010#M112176</link>
      <description>&lt;P&gt;Autocad, when asking for the first coordinate (numeric value) of the second point, probably doesnt uderstand the argument f.e. "@123,256" [retrurn value of (strcat "@" (rtos o_width) "," (rtos o_height) ",0" ]&lt;BR /&gt;becouse it still asks for the X coordinate. Even if I separate the inside the (strcat) like so:&lt;/P&gt;&lt;PRE&gt;(command "_rectang" p1 "@" o_width o_height)&lt;/PRE&gt;&lt;P&gt;&lt;BR /&gt;autocad doesnt accept "@" to let the user pass the width and height, but draws a rectangle with corners of the same coordinates as p1 (in one point).&lt;/P&gt;&lt;P&gt;I wonder if there's a way to make autocad understand "@". (command "@" ) doesnt work...&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 17:36:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540010#M112176</guid>
      <dc:creator>andkal</dc:creator>
      <dc:date>2017-11-13T17:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540085#M112177</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/856802"&gt;@andkal&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Autocad, when asking for the first coordinate (numeric value) of the second point, probably doesnt uderstand the argument f.e. "@123,256" [retrurn value of (strcat "@" (rtos o_width) "," (rtos o_height) ",0" ]&lt;BR /&gt;becouse it still asks for the X coordinate. Even if I separate the inside the (strcat) like so:&lt;/P&gt;
&lt;PRE&gt;(command "_rectang" p1 "@" o_width o_height)&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;autocad doesnt accept "@" to let the user pass the width and height, but draws a rectangle with corners of the same coordinates as p1 (in one point).&lt;/P&gt;
&lt;P&gt;I wonder if there's a way to make autocad understand "@". (command "@" ) doesnt work...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Post 6 has an additional ",0" at the end. Rectangle needs a 2d point. Get rid of that &lt;EM&gt;0&lt;/EM&gt;&lt;/P&gt;
&lt;PRE&gt;        (setq p1 ip)
	(command "_rectang"
		p1		
		(strcat "@" (rtos o_width) "," (rtos o_height))
	)
&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Nov 2017 17:55:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540085#M112177</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-11-13T17:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540101#M112178</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/856802"&gt;@andkal&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;...&amp;nbsp;doesnt accept "@" to let the user pass the width and height, but draws a rectangle with corners of the same coordinates as p1 (in one point).&lt;/P&gt;
&lt;P&gt;I wonder if there's a way to make autocad understand "@". (command "@" ) doesnt work...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It does recognize it, but "@" &lt;EM&gt;by itself&lt;/EM&gt;&amp;nbsp; specifically &lt;EM&gt;means&lt;/EM&gt;&amp;nbsp; at the same place as the last point, equivalent to "@0,0" [or, where XYZ points are accepted, "@0,0,0"].&amp;nbsp; Try &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555"&gt;@Ranjit_Singh&lt;/a&gt;'s suggestion to omit the Z coordinate from the second point -- that kind of correction is what I get for not testing it.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 18:03:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540101#M112178</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-13T18:03:22Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540102#M112179</link>
      <description>&lt;P&gt;OK, it works now. I missunderstood why it didnt work&lt;/P&gt;</description>
      <pubDate>Mon, 13 Nov 2017 18:23:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7540102#M112179</guid>
      <dc:creator>andkal</dc:creator>
      <dc:date>2017-11-13T18:23:03Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7543558#M112180</link>
      <description>This is all getting stupid.  What matters more, the looks of the code or&lt;BR /&gt;the results of the code?&lt;BR /&gt;p1 and p2 give you results.</description>
      <pubDate>Tue, 14 Nov 2017 17:24:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7543558#M112180</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-14T17:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558141#M112181</link>
      <description>&lt;P&gt;Maybe i asked a wrong question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using _rectang or any other functions you may input second ( or n-th) point using relatve dimensions (with@) Is there a way to code that way an autolisp without any additional questions ( PROMPT: "Do you want choose second &lt;U&gt;&lt;STRONG&gt;P&lt;/STRONG&gt;&lt;/U&gt;oint or pass &lt;U&gt;&lt;STRONG&gt;R&lt;/STRONG&gt;&lt;/U&gt;elative distance?&amp;nbsp; P/R") &amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be handy for user if he will have both input methods without anserwing questions in command line&amp;nbsp;&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;</description>
      <pubDate>Mon, 20 Nov 2017 12:21:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558141#M112181</guid>
      <dc:creator>126843</dc:creator>
      <dc:date>2017-11-20T12:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558186#M112182</link>
      <description>&lt;P&gt;Maybe it can be done by writing function which recognize user input data type: point or real?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But how to done it?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 12:31:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558186#M112182</guid>
      <dc:creator>126843</dc:creator>
      <dc:date>2017-11-20T12:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558271#M112183</link>
      <description>&lt;P&gt;If I recall correctly, all AutoCAD commands prompt for the "next" point, so it's just a matter of how you wish to acquire it and then provide it to the command.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 12:57:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558271#M112183</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-20T12:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558485#M112184</link>
      <description>&lt;P&gt;Yes but you can do it in two ways. You can pass direct coordinates (or click on screen) or pass&amp;nbsp; indirect coordinates using "@" and autocad can handle it. How they done it?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 14:01:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558485#M112184</guid>
      <dc:creator>126843</dc:creator>
      <dc:date>2017-11-20T14:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558572#M112185</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2351286"&gt;@126843&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It will be handy for user if he will have both input methods without anserwing questions in command line&amp;nbsp;&lt;/P&gt;
&lt;P&gt;....&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;An ordinary &lt;FONT color="#ff0000"&gt;pause&lt;/FONT&gt; will allow both input methods:&lt;/P&gt;
&lt;P&gt;(command "_rectang" p1 &lt;FONT color="#ff0000"&gt;pause&lt;/FONT&gt; .....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if you're trying to incorporate a value from a variable, I can't imagine a way to have an option to use it in either absolute or relative terms &lt;EM&gt;without&lt;/EM&gt;&amp;nbsp; the User answering some kind of question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or am I misunderstanding what you want to do?&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 14:19:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558572#M112185</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-20T14:19:52Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558619#M112186</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2351286"&gt;@126843&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Maybe it can be done by writing function which recognize user input data type: point or real?&lt;/P&gt;
&lt;P&gt;....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You can have it distinguish between those two data types:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Command: &lt;FONT color="#ff0000"&gt;(initget 128)&lt;/FONT&gt; &lt;EM&gt;&lt;FONT color="#33cccc"&gt;; to accept arbitrary input, i.e. a typed number rather than a point pick in a (getpoint) function&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Command: &lt;FONT color="#ff0000"&gt;(setq test (getpoint "\nPick point or type real number: "))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Pick point or type real number: &lt;FONT color="#0000ff"&gt;(30.9431 11.5841 0.0)&lt;/FONT&gt; &lt;EM&gt;&lt;FONT color="#33cccc"&gt;; picked a point&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Command: &lt;FONT color="#ff0000"&gt;(type test)&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;LIST&lt;/STRONG&gt; &lt;EM&gt;&lt;FONT color="#33cccc"&gt;; the "type" that a point is&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Command: &lt;FONT color="#ff0000"&gt;(initget 128)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Command: &lt;FONT color="#ff0000"&gt;(setq test (getpoint "\nPick point or type real number: "))&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Pick point or type real number: &lt;FONT color="#ff00ff"&gt;1.2345&lt;/FONT&gt; &lt;EM&gt;&lt;FONT color="#33cccc"&gt;; typed a number:&lt;/FONT&gt;&lt;/EM&gt;&lt;BR /&gt;&lt;FONT color="#0000ff"&gt;"1.2345"&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;Command: &lt;FONT color="#ff0000"&gt;(type test)&lt;/FONT&gt;&lt;BR /&gt;&lt;STRONG&gt;STR&lt;/STRONG&gt; &lt;EM&gt;&lt;FONT color="#33cccc"&gt;; the "type" of the User input&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you would have to convert that string to a number with (atof).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried using (get&lt;EM&gt;real &lt;/EM&gt;) instead of (get&lt;EM&gt;point &lt;/EM&gt;), to get around the String-type return needing conversion, but unfortunately,&amp;nbsp;(initget 128) for arbitrary input accepts only arbitrary &lt;EM&gt;typed&lt;/EM&gt; &amp;nbsp;input, not a point pick.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 14:32:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7558619#M112186</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2017-11-20T14:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7559039#M112187</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2351286"&gt;@126843&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Yes but you can do it in two ways. You can pass &lt;EM&gt;&lt;STRONG&gt;direct coordinates (or click on screen) or pass&amp;nbsp; indirect coordinates using "@" and autocad can handle it&lt;/STRONG&gt;&lt;/EM&gt;. How they done it?&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;EM&gt;How they done it? &lt;/EM&gt;I am not sure. But try something like this. it should allow picking on screen or passing relative co-ordinates.&lt;/P&gt;
&lt;PRE&gt;(defun c:somefunc  (/ p1 p2)
 (setq p2 (getcorner "\n Specify second point (you can use relative co-ords here or pick on screen): "
                    (setq p1 (getpoint "\nSpecify first point: "))))
 (command "._rectang" p1 p2))&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Relative_coordinates_always_allowed.gif" style="width: 705px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/428669i45D3F5780371F7E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="Relative_coordinates_always_allowed.gif" alt="Relative_coordinates_always_allowed.gif" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 16:18:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7559039#M112187</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2017-11-20T16:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7559320#M112188</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2351286"&gt;@126843&lt;/a&gt; wrote:&lt;BR /&gt;&lt;P&gt;Maybe i asked a wrong question&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you are using _rectang or any other functions you may input second ( or n-th) point using relatve dimensions (with@) Is there a way to code that way an autolisp without any additional questions ( PROMPT: "Do you want choose second &lt;U&gt;&lt;STRONG&gt;P&lt;/STRONG&gt;&lt;/U&gt;oint or pass &lt;U&gt;&lt;STRONG&gt;R&lt;/STRONG&gt;&lt;/U&gt;elative distance?&amp;nbsp; P/R") &amp;nbsp; ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It will be handy for user if he will have both input methods without anserwing questions in command line&amp;nbsp;&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;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;@I don't see the point to that, because the user already has the ability to use relative or absolute coordinate entry at any prompt, including those issued by your calls to (getpoint). The "@" means relative to the last point entered (which is stored in the LASTPOINT system variable). So, they can type&amp;nbsp;@ in front of either a Cartesian or polar coordinate entry to enter a relative cartesian or polar coordinate.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Deviating from the standards that AutoCAD uses for data entry is not a best-practice.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 17:33:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7559320#M112188</guid>
      <dc:creator>ActivistInvestor</dc:creator>
      <dc:date>2017-11-20T17:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: Passing variable as relative in COMMAND function</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7559868#M112189</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/4476837"&gt;@ActivistInvestor&lt;/a&gt;&amp;nbsp;wrote: "&lt;SPAN&gt;the ability to use relative or absolute coordinate entry at any prompt, including those issued by your calls to (getpoint). The "@" means relative to the last point entered (which is stored in the LASTPOINT system variable)."&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Just a slight clarification:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;The point stored in the LASTPOINT sysvar is one entered into an AutoCAD command,not necessarily one acquired by an AutoLisp function such as getpoint.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example, if you (setq p1 (getpoint)), (getvar "LASTPOINT") will probably not return the value of p1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;BUT, LASTPOINT is not read-only, so you could (setvar "LASTPOINT" p1)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Nov 2017 20:11:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/passing-variable-as-relative-in-command-function/m-p/7559868#M112189</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2017-11-20T20:11:17Z</dc:date>
    </item>
  </channel>
</rss>

