<?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 Ynt: Texts to listbox C# in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140972#M17346</link>
    <description>&lt;P&gt;Sesli de hazırlarım. Ancak ücretli ile tam istediğim sonucu alamayabiliriz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Öğrenmem gerekiyor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Teşekkürler.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Mar 2021 04:18:43 GMT</pubDate>
    <dc:creator>k005</dc:creator>
    <dc:date>2021-03-09T04:18:43Z</dc:date>
    <item>
      <title>Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10125918#M17334</link>
      <description>&lt;P&gt;How can I send text objects in the dwg file to the listbox by selecting them?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;common feature in texts to be selected = &lt;STRONG&gt;ø&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;sample text:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;51&lt;STRONG&gt;ø&lt;/STRONG&gt;16 / 20&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 03 Mar 2021 08:31:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10125918#M17334</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-03T08:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10138017#M17335</link>
      <description>&lt;P&gt;hi&lt;/P&gt;&lt;P&gt;do use wpf or winforms?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 07:16:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10138017#M17335</guid>
      <dc:creator>essam-salah</dc:creator>
      <dc:date>2021-03-08T07:16:09Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10138141#M17336</link>
      <description>&lt;P&gt;Winforms&amp;nbsp;&amp;nbsp;&amp;nbsp; ( .dll )&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 08:31:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10138141#M17336</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-08T08:31:25Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10138466#M17337</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537692"&gt;@k005&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just create .NetFramwork ClassLibrary and add System.Windows.Forms assembly to your project references,&lt;/P&gt;&lt;P&gt;and try this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using aDB = Autodesk.AutoCAD.DatabaseServices;
using aApp = Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.EditorInput;
using Autodesk.AutoCAD.Runtime;
using aGeom = Autodesk.AutoCAD.Geometry;

namespace ACADAPITutorial
{
    public class TextToListBox
    {
        #region current doc
        static aApp.Document aDoc =&amp;gt; aApp.Application.DocumentManager.MdiActiveDocument;
        #endregion

        #region initialize
        private static bool isDialogOpen = false;
        private static SelectionDialog dialog;

        static TextToListBox()
        {
            dialog = new SelectionDialog();
            dialog.SelectBtm.Click += SelectBtm_Click;
            dialog.FormClosing += Dialog_FormClosing;
        }
        static void Dialog_FormClosing(object sender, System.Windows.Forms.FormClosingEventArgs e)
        {
            e.Cancel = true;
            dialog.Hide();
            isDialogOpen = false;
        }
        #endregion

        // select text
        private static void SelectBtm_Click(object sender, EventArgs e)
        {
            // define filter
            // TypedValue /filter criteria
            var typeValueArray = new aDB.TypedValue[]
            {
                    new aDB.TypedValue((int)aDB.DxfCode.Operator, "&amp;lt;or"), // start ORing
                    new aDB.TypedValue((int)aDB.DxfCode.Start, "Text"),
                    new aDB.TypedValue((int)aDB.DxfCode.Start, "MText"),
                    new aDB.TypedValue((int)aDB.DxfCode.Operator, "or&amp;gt;"), // end ORing
                    // to get any ACAD Obj dxf name (Text, MText , ...) use ACAD LIST command.
            }; 
            var filter = new SelectionFilter(typeValueArray);
            // selection options
            var selectionOptions = new PromptSelectionOptions()
            {
                MessageForAdding = "select texts",
            };
            // Request for objects to be selected in the drawing area
            var selectionResult = aDoc.Editor.GetSelection(selectionOptions, filter);
            // If the prompt status is OK, objects were selected
            if (selectionResult.Status != PromptStatus.OK)
            {
                aDoc.Editor.WriteMessage($"\n----- No selection found ------");
                return;
            }
            // get object IDs
            var allTextIDs = selectionResult.Value.GetObjectIds();
            List&amp;lt;string&amp;gt; allText = new List&amp;lt;string&amp;gt;();
            using (var ts = aDB.HostApplicationServices.WorkingDatabase.TransactionManager.StartTransaction())
            {
                Type type;
                foreach (var id in allTextIDs)
                {
                    var dbObj = id.GetObject(aDB.OpenMode.ForRead);
                    type = dbObj.GetType();
                    if (type.Equals(typeof(aDB.DBText)))
                    {
                        allText.Add(((aDB.DBText)dbObj).TextString);
                    }
                    else if (type.Equals(typeof(aDB.MText)))
                    {
                        allText.Add(((aDB.MText)dbObj).Text);
                    }
                }
            }
            dialog.ListBox.DataSource = allText;
        }

        [CommandMethod("cieSelectText")]
        public void SelectText()
        {
            // check already opened
            if (isDialogOpen) return;
            // show modeless dialog
            aApp.Application.ShowModelessDialog(dialog);
            isDialogOpen = true;
        }
    }
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and here is a simple form:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;public class SelectionDialog : System.Windows.Forms.Form
    {
        public System.Windows.Forms.ListBox ListBox { get; private set; }
        public System.Windows.Forms.Button SelectBtm { get; private set; }

        public SelectionDialog()
        {
            SelectBtm = new System.Windows.Forms.Button()
            {
                Text = "select...",
            };
            ListBox = new System.Windows.Forms.ListBox()
            { 
            
            };
            // wrap all controls into a panel
            var panel = new System.Windows.Forms.FlowLayoutPanel()
            {
                AutoScroll = true,
                FlowDirection = System.Windows.Forms.FlowDirection.TopDown,
                WrapContents = false,
            };
            panel.Controls.Add(SelectBtm);
            panel.Controls.Add(ListBox);
            // add controls to dialog
            this.Controls.Add(panel);
        }
    }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 11:28:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10138466#M17337</guid>
      <dc:creator>essam-salah</dc:creator>
      <dc:date>2021-03-08T11:28:32Z</dc:date>
    </item>
    <item>
      <title>Ynt: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139562#M17338</link>
      <description>&lt;P&gt;I received the articles with the code you selected (text object) and sent to the listbox. I took one more step thanks to you. If I can complete it, it will be a good work.&lt;/P&gt;&lt;P&gt;Thank you so much..&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="yazılar.png" style="width: 456px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/890263iD8435EA23085AECB/image-size/large?v=v2&amp;amp;px=999" role="button" title="yazılar.png" alt="yazılar.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:03:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139562#M17338</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-08T18:03:21Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139570#M17339</link>
      <description>&lt;P&gt;I could not integrate the codes you sent to the project I was working on. I'm new to C #. I prepared a screen video to detail the subject.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="AcadPlugin" href="https://www.dosya.tc/server33/j393xz/AcadPlugin.rar.html" target="_blank" rel="noopener"&gt;https://www.dosya.tc/server33/j393xz/AcadPlugin.rar.html&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The choice will be based on the Layer and Text text. Mtext is not included in the selection.&lt;/P&gt;&lt;P&gt;Some texts (text objects) are composed of 2 texts, while some texts are 3 parts. I do not know how we can edit this. It takes a very long time.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;For now, just: If we can take 3 pieces or 2 pieces of text like 1 51ø16 / 200 L = 10500 and put it into the listbox, it is enough for now.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you very much for your help and Codes.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 17:43:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139570#M17339</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-08T17:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139676#M17340</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537692"&gt;@k005&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;couldn't open the .zip file you attached i think it's better if you make it a GIF so we can see it or a link to YouTube video,&lt;/P&gt;&lt;P&gt;if you want to select Text in a specific layer just change the above code typeValueArray to:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt; var myLayerName = "myLayer";
            var typeValueArray = new aDB.TypedValue[]
            {
                    new aDB.TypedValue((int)aDB.DxfCode.Operator, "&amp;lt;and"),
                    new aDB.TypedValue((int)aDB.DxfCode.Start, "Text"),
                    new aDB.TypedValue((int)aDB.DxfCode.LayerName, myLayerName),
                    new aDB.TypedValue((int)aDB.DxfCode.Operator, "and&amp;gt;"), 
            };&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and the question about a Text with text parts isn't clear actually,&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:17:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139676#M17340</guid>
      <dc:creator>essam-salah</dc:creator>
      <dc:date>2021-03-08T18:17:16Z</dc:date>
    </item>
    <item>
      <title>Ynt: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139697#M17341</link>
      <description>&lt;P&gt;our road map has been determined. We must proceed from this part...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SelectBtm_Click&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:21:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139697#M17341</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-08T18:21:35Z</dc:date>
    </item>
    <item>
      <title>Ynt: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139712#M17342</link>
      <description>&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:29:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139712#M17342</guid>
      <dc:creator>essam-salah</dc:creator>
      <dc:date>2021-03-08T18:29:26Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139758#M17343</link>
      <description>&lt;P&gt;Acadplugin2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="Acadplugin2" href="https://easyupload.io/9yip6y" target="_blank" rel="noopener"&gt;https://easyupload.io/9yip6y&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 18:39:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139758#M17343</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-08T18:39:42Z</dc:date>
    </item>
    <item>
      <title>Ynt: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139858#M17344</link>
      <description>&lt;P&gt;Merhaba videoları nı sesli çekeydin iyi olurdu donatı metraj programına yardımcı olurum.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 19:23:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10139858#M17344</guid>
      <dc:creator>mttlp</dc:creator>
      <dc:date>2021-03-08T19:23:56Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140105#M17345</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/537692"&gt;@k005&lt;/a&gt;&amp;nbsp;, i got your video&lt;/P&gt;&lt;P&gt;man it's a big task i don't think someone here will give you a complete project,&lt;/P&gt;&lt;P&gt;what i understand is you have some texts in your drawing and each 3(or 2) texts are related to each other which gives information about a rebar and your task is to collect these related texts together .&lt;/P&gt;&lt;P&gt;since you are not expert i suggest to look for someone in the industry.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Mar 2021 20:41:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140105#M17345</guid>
      <dc:creator>essam-salah</dc:creator>
      <dc:date>2021-03-08T20:41:20Z</dc:date>
    </item>
    <item>
      <title>Ynt: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140972#M17346</link>
      <description>&lt;P&gt;Sesli de hazırlarım. Ancak ücretli ile tam istediğim sonucu alamayabiliriz.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Öğrenmem gerekiyor.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Teşekkürler.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 04:18:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140972#M17346</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-09T04:18:43Z</dc:date>
    </item>
    <item>
      <title>Re: Texts to listbox C#</title>
      <link>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140982#M17347</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3650456"&gt;@essam-salah&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes . the subject is exactly as you said. I am not an expert. but I understood the code structure. I need to get a listbox with Text objects filtered. I have included some of the code you sent in my Project.&lt;/P&gt;&lt;P&gt;Now the filtering is left.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Mar 2021 04:26:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/texts-to-listbox-c/m-p/10140982#M17347</guid>
      <dc:creator>k005</dc:creator>
      <dc:date>2021-03-09T04:26:31Z</dc:date>
    </item>
  </channel>
</rss>

