<?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 Passing textbox value to lisp function in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962481#M8836</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have designed windows form via C# for a lisp program. I need to pass some text boxes value on windows form to Lisp function then running the function.&lt;/P&gt;&lt;P&gt;Is it possible ?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 14 May 2023 09:18:02 GMT</pubDate>
    <dc:creator>bahman.jf.68</dc:creator>
    <dc:date>2023-05-14T09:18:02Z</dc:date>
    <item>
      <title>Passing textbox value to lisp function</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962481#M8836</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I have designed windows form via C# for a lisp program. I need to pass some text boxes value on windows form to Lisp function then running the function.&lt;/P&gt;&lt;P&gt;Is it possible ?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 09:18:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962481#M8836</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2023-05-14T09:18:02Z</dc:date>
    </item>
    <item>
      <title>Re: Passing textbox value to lisp function</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962526#M8837</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You should provide more details. How do call the C# from LISP? If you use C# LispFunction method, this method can simple return a TextBox contents as a ResultBuffer which will be seen as a LISP list on the LISP side.&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 10:26:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962526#M8837</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-05-14T10:26:50Z</dc:date>
    </item>
    <item>
      <title>Re: Passing textbox value to lisp function</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962553#M8838</link>
      <description>&lt;P&gt;I don't want to call C# from Lisp,&amp;nbsp;&lt;BR /&gt;I designed a form with C# .Net and user runs the form with command then filling the textboxes on the form. After clicking a button, all data (textboxe's values) should pass to a Lisp Function.&lt;/P&gt;&lt;P&gt;Suppose I have a Lisp Function like this :&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;(defun drawcircle (dm txt)&lt;/P&gt;&lt;P&gt;(setq pt (getpoint "Pick a point to add cricle")&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(command "circle" pt "d" dm)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;(command "text" "j" "mc" pt 2 0.0 txt)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There are two arguments in this function and this values should be run from C# with this values of the form. (The user enter diameter and the text on form)&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 11:20:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962553#M8838</guid>
      <dc:creator>bahman.jf.68</dc:creator>
      <dc:date>2023-05-14T11:20:45Z</dc:date>
    </item>
    <item>
      <title>Re: Passing textbox value to lisp function</title>
      <link>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962596#M8839</link>
      <description>&lt;P&gt;To call a LISP function, you should use &lt;A href="https://help.autodesk.com/view/OARX/2019/ENU/?guid=OREFNET-Autodesk_AutoCAD_ApplicationServices_Core_Application_Invoke_ResultBuffer" target="_blank" rel="noopener nofollow noreferrer"&gt;Application.Invoke()&lt;/A&gt; method. To make the function accessible, you have to use &lt;A href="https://help.autodesk.com/view/OARX/2023/ENU/?guid=GUID-D15CB87F-5B69-4BC3-B8BB-E45D57602B27" target="_blank" rel="nofollow noopener noreferrer"&gt;vl-acad-defun&lt;/A&gt; on the LISP side: (vl-acad-defun 'drawcircle).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="csharp"&gt;var args = new ResultBuffer(
    new TypedValue((int)LispDataType.Text, "drawcircle"), // &amp;lt;- LISP function name
    new TypedValue((int)LispDataType.Double, double.Parse(textBoxDm.Text)), // &amp;lt;- dm argument
    new TypedValue((int)LispDataType.Text, textBoxTxt.Text)); // &amp;lt;- txt argument
Application.Invoke(args);&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;IMHO, trying to mix LISP and .NET is most of the time more complex and less robust than converting the LISP part into .NET.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 14 May 2023 12:01:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/passing-textbox-value-to-lisp-function/m-p/11962596#M8839</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2023-05-14T12:01:40Z</dc:date>
    </item>
  </channel>
</rss>

