access all cadpicturebox entities

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
Masoud
Posts: 13
Joined: 25 May 2022, 18:57

access all cadpicturebox entities

Post by Masoud » 05 Mar 2023, 16:55

Hello
How can I access all cadpicturebox entities?

I want to delete all the text entities created by the cadpicturebox environment

tnx for your help

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

Re: access all cadpicturebox entities

Post by support » 06 Mar 2023, 16:41

Masoud wrote:
05 Mar 2023, 16:55
Hello
How can I access all cadpicturebox entities?

I want to delete all the text entities created by the cadpicturebox environment

tnx for your help
Hello,
To delete entities from the current layout (cadImage.CurrentLayout) you should iterate all the entities on the layout, compare their types and delete cadImage.RemoveEntity(ent);

Code: Select all

private void button1_Click(object sender, EventArgs e)
        {
   if (cadImage == null) return;
   var collection = cadImage.CurrentLayout.Entities;
   int cnt = cadImage.CurrentLayout.Entities.Count;
   while (cnt > 0)
            {
    CADEntity ent = cadImage.CurrentLayout.Entities[cnt-1];
    if (ent is CADText || ent is CADMText)
                {     
     cadImage.RemoveEntity(ent);
                }
    cnt--;
            }   
   
   cadPictBox.Invalidate();}
Regards,
Catherine
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Masoud
Posts: 13
Joined: 25 May 2022, 18:57

Re: access all cadpicturebox entities

Post by Masoud » 07 Mar 2023, 18:26

thank you Catherine

WilliamVance
Posts: 1
Joined: 15 Mar 2023, 08:43

Re: access all cadpicturebox entities

Post by WilliamVance » 15 Mar 2023, 12:53

support wrote:
06 Mar 2023, 16:41
Masoud wrote:
05 Mar 2023, 16:55
Hello
How can I access all cadpicturebox entities?

I want to delete all the text entities created by the cadpicturebox environment

tnx for your help
Hello,
To delete entities from the current layout (cadImage.CurrentLayout) you should iterate all the entities on the layout, compare their types and delete cadImage.RemoveEntity(ent);

Code: Select all

private void button1_Click(object sender, EventArgs e)
        {
   if (cadImage == null) return;
   var collection = cadImage.CurrentLayout.Entities;
   int cnt = cadImage.CurrentLayout.Entities.Count;
   while (cnt > 0)
            {
    CADEntity ent = cadImage.CurrentLayout.Entities[cnt-1];
    if (ent is CADText || ent is CADMText)
                {     
     cadImage.RemoveEntity(ent);
                }
    cnt--;
            }   
   
   cadPictBox.Invalidate();}
Regards,
Catherine
Ok, I will do it as you said and if I face any problem, I will message you.
But before that, I want to earn money by playing CAD Casinos games and I already found the https://casinosanalyzer.ca/online-casin ... dollar-cad website link where I found those links through which I can earn more money.

Post Reply