get text in the collection of CADTEXT

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
user20
Posts: 1
Joined: 07 Dec 2022, 10:20

get text in the collection of CADTEXT

Post by user20 » 07 Dec 2022, 10:34

Hi
I select texts in my dwg and want get string or text of that selected texts!
Image

for example I use this code:

Code: Select all

cadImageFld.SelectedEntities.Item(1).unicodetext
but not usefull!
please guide me.

support
Posts: 3271
Joined: 30 Mar 2005, 11:36
Contact:

Re: get text in the collection of CADTEXT

Post by support » 07 Dec 2022, 14:12

user20 wrote:
07 Dec 2022, 10:34
Hi
I select texts in my dwg and want get string or text of that selected texts!
Image

for example I use this code:

Code: Select all

cadImageFld.SelectedEntities.Item(1).unicodetext
but not usefull!
please guide me.
Hi,
The instance of the CADText class stores Text in the TEXT property:

Code: Select all

string getCADTextString=yournamedcadtextentity.Text;
So, in your case if you select the texts, the code example will be (select CADText in the Editor demo):

Code: Select all

private string gettext;
        private void menuItem8_Click(object sender, EventArgs e)
        {
   if (cadImage == null) return;
   foreach(CADEntity ent in cadImage.SelectedEntities)
            {
    if (ent is CADText)
     gettext = ((CADText)ent).Text;
            }
        }
Best regards,
Catherine.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply