Add Our own Entities in Control

Discuss and ask questions about CAD .NET library.

Moderators: SDS, support, admin

Post Reply
archna
Posts: 5
Joined: 21 Oct 2010, 16:47

Add Our own Entities in Control

Post by archna » 21 Oct 2010, 16:52

We want to display the floor plan, And in the run time user can add his/her own entities by dropping some object on the floor plan. The Entity should appear on the same point as it was dropped. I tries to use cadeditor control. But I am not able to get how can I draw my own object(Object can be triangle, circle or polygon) on the drawing. Pl

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

Re: Add Our own Entities in Control

Post by support » 22 Oct 2010, 12:32

Hello.
CADEditorControl functionality can be used to create some entities visually, by mouse. Another way is addind your own entities created and customized programmatically. The following is the example of creating CADCircle object at specified point:

Code: Select all

        if (this.cadImage == null)
        {
                this.cadImage = new CADImage();
                this.cadImage.InitialNewImage();
        }
                
        this.cadImage.UseDoubleBuffering = false;
                
        CADCircle ent = new CADCircle();
        ent.Point = //here you can specify the insertion point
        ent.Radius = 50;
        ent.Color = Color.Red;
        ent.Loaded(this.cadImage.Converter);
        this.cadImage.Converter.OnCreate(ent);
        this.cadImage.CurrentLayout.AddEntity(ent); 

        this.cadPictBox.Invalidate();
here CADImport.CADImage cadImage, CADImport.FaceModule.CADPictureBox cadPictBox are the fields of the form. You can paste this code to CADPictBox_MouseDown event in Viewer demo and set

Code: Select all

ent.Point = this.GetRealPoint(e.X, e.Y);
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

archna
Posts: 5
Joined: 21 Oct 2010, 16:47

Re: Add Our own Entities in Control

Post by archna » 22 Oct 2010, 14:54

Thanks


I have one question can we add tool tip to the cad circle object

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

Re: Add Our own Entities in Control

Post by support » 22 Oct 2010, 18:15

Hello.
CAD Import .NET entities specification based on DWG/DXF entities specification. There is no such entity property or method. However you can realize Tooltip functionality in your own application.

Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support

Post Reply