Page 1 of 1
Add Our own Entities in Control
Posted: 21 Oct 2010, 16:52
by archna
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
Re: Add Our own Entities in Control
Posted: 22 Oct 2010, 12:32
by support
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.
Re: Add Our own Entities in Control
Posted: 22 Oct 2010, 14:54
by archna
Thanks
I have one question can we add tool tip to the cad circle object
Re: Add Our own Entities in Control
Posted: 22 Oct 2010, 18:15
by support
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.