<?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 AutoLISP messagebox to C# text box in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6925792#M32413</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using AutoLISP for measuring total length of a line and it shows autocad message box as shown in picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 283px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/330080i043AEAEA5E1A0C62/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to display the length into winform of C#.&lt;/P&gt;&lt;P&gt;is it possible to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any kind of help is badly needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Banna&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Mar 2017 08:03:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-07T08:03:23Z</dc:date>
    <item>
      <title>AutoLISP messagebox to C# text box</title>
      <link>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6925792#M32413</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using AutoLISP for measuring total length of a line and it shows autocad message box as shown in picture.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Capture.JPG" style="width: 283px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/330080i043AEAEA5E1A0C62/image-size/large?v=v2&amp;amp;px=999" role="button" title="Capture.JPG" alt="Capture.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I want to display the length into winform of C#.&lt;/P&gt;&lt;P&gt;is it possible to do that?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any kind of help is badly needed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Banna&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 08:03:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6925792#M32413</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-07T08:03:23Z</dc:date>
    </item>
    <item>
      <title>Re : AutoLISP messagebox to C# text box</title>
      <link>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6925843#M32414</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Mixing LISP and .NET often brings more issues than easy solutions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, you can show a winform from within LispFunction attributed method.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 08:32:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6925843#M32414</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-03-07T08:32:12Z</dc:date>
    </item>
    <item>
      <title>Re : AutoLISP messagebox to C# text box</title>
      <link>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6926853#M32415</link>
      <description>&lt;P&gt;Doesn't even need to be a winform - a MessageBox would do, as it's very similar to the LISP (alert ...) function.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Mar 2017 15:39:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6926853#M32415</guid>
      <dc:creator>dgorsman</dc:creator>
      <dc:date>2017-03-07T15:39:44Z</dc:date>
    </item>
    <item>
      <title>Re : AutoLISP messagebox to C# text box</title>
      <link>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6928258#M32416</link>
      <description>&lt;P&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Can you please share the code?&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Mar 2017 00:08:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6928258#M32416</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-08T00:08:57Z</dc:date>
    </item>
    <item>
      <title>Re : AutoLISP messagebox to C# text box</title>
      <link>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6928891#M32417</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To use the standard MessageBox, you can simply build a simple LispFunction method:&lt;/P&gt;
&lt;PRE&gt;        [LispFunction("messagebox")]
        public bool MessagegBox(ResultBuffer resbuf)
        {
            if (resbuf != null)
            {
                var arg = resbuf.AsArray()[0];
                if (arg.TypeCode == (int)LispDataType.Text)
                {
                    MessageBox.Show(arg.Value.ToString());
                    return true;
                }
            }
            return false;
        }&lt;/PRE&gt;
&lt;P&gt;Usage:&lt;/P&gt;
&lt;PRE&gt;(messagebox "Total length of selected objects is 1523.401")&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to use a "custom" message box, you can use the same way.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A trivial example of custom message box:&lt;/P&gt;
&lt;PRE&gt;    public class MsgBox : Form
    {
        public MsgBox(string msg)
        {
            Size = new System.Drawing.Size(250, 110);
            StartPosition = FormStartPosition.CenterParent;
            Text = "Message from LISP";
            FormBorderStyle = FormBorderStyle.FixedDialog;
            AutoSize = true;
            MinimizeBox = false;
            MaximizeBox = false;

            Controls.Add(new Label()
            {
                AutoSize = true,
                Location = new System.Drawing.Point(13, 13),
                Text = msg
            });

            Controls.Add(new Button
            {
                DialogResult = DialogResult.OK,
                Location = new System.Drawing.Point(80, 37),
                Text = "OK"
            });
        }
    }&lt;/PRE&gt;
&lt;P&gt;The LISP function:&lt;/P&gt;
&lt;PRE&gt;        [LispFunction("msgbox")]
        public bool MsgBox(ResultBuffer resbuf)
        {
            if (resbuf != null)
            {
                var arg = resbuf.AsArray()[0];
                if (arg.TypeCode == (int)LispDataType.Text)
                {
                    using (var dlg = new MsgBox(arg.Value.ToString()))
                    {
                        Autodesk.AutoCAD.ApplicationServices.Application.ShowModalDialog(dlg);
                    }
                    return true;
                }
            }
            return false;
        }&lt;/PRE&gt;
&lt;P&gt;Usage:&lt;/P&gt;
&lt;PRE&gt;(msgbox "Total length of selected objects is 1523.401")&lt;/PRE&gt;</description>
      <pubDate>Wed, 08 Mar 2017 07:49:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autolisp-messagebox-to-c-text-box/m-p/6928891#M32417</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2017-03-08T07:49:22Z</dc:date>
    </item>
  </channel>
</rss>

