Iterate entities into dwg file

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
monty
Posts: 1
Joined: 17 Jul 2008, 17:44

Iterate entities into dwg file

Post by monty » 17 Jul 2008, 19:21

Hy,

I want to iterate from one layer all their entities, could do you help me?

I load a dwg file using editor control for your professional version (CADImport .Net). But I don't find some method that enable to do it from CADImport.CADImportControls.CADEditorControl object.

Thank you very much indeed.

Monty

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

Re: Iterate entities into dwg file

Post by support » 18 Jul 2008, 15:25

Hello Monty,

Please try the following code:

Code: Select all

private void button1_Click(object sender, System.EventArgs e)
{
	CADImport.CADEntity ent;
	int entNumber = this.cadEditorControl.Image.Converter.GetCounts(CADImport.FaceModule.ConvSection.Entities);
	for (int i=0;i<entNumber;i++)
	{
		ent = (CADImport.CADEntity)this.cadEditorControl.Image.Converter.GetSection(CADImport.FaceModule.ConvSection.Entities).Entities[i];
		if (ent.Layer.Name == "sought_for_layer")
		{
			//Do necessary actions
		}
		}			
}
Sergey.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply