How to select and edit group of entities using C#.Net

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
onbabu
Posts: 1
Joined: 14 Jul 2018, 08:37

How to select and edit group of entities using C#.Net

Post by onbabu » 14 Jul 2018, 08:48

Hi,
I am new to Auto CAD, and I am a C#.Net developer, one of my project requirement is
1. Need to Open a .dwg or .dxf file and show the drawing in windows form or asp form with properties like Pan, Zoom In, Zoom Out, Single Entity Selection or Multiple Entities Selection( Window Selection with Mouse Drag).
2.If User Selects a group of entities by mouse drag (window selection), i need the text available in that selected window in a table format, which i can save or manipulate

Was this achievable by using CAD.Net tool, if possible please provide a sample code for testing.

Thanks & Regards,
Narendra

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

Re: How to select and edit group of entities using C#.Net

Post by support » 16 Jul 2018, 22:40

Hello Narendra,

CAD .NET library fulfils your requirements, it provides a ready-to-use CADEditorControl which supports the following features:
  • Opening a .dwg or .dxf file and displaying the drawing in Windows Forms application.
  • Panning (by holding the right mouse button), zooming in/out (by the mouse wheel or toolbar buttons).
  • Single entity selection (by clicking the left mouse button), multiple entities selection (window selection).
  • Storing the currently selected entities in a CADEntityCollection which can be accessed through a CADEditorControl.Image.SelectedEntities property.
When you need to filter out a group of entities of a certain type from the current entity selection, it can be done with a one line of code. The example below shows how to filter out the TEXT entities.

Code: Select all

using System;
using System.Collections.Generic;
using CADImport;

...

List<CADEntity> cadTexts = cadEditorControl1.Image.SelectedEntities.FindAll(ent => ent.EntType == EntityType.Text);
Mikhail
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply