Page 1 of 1

CADEditorControl Help

Posted: 17 Jan 2016, 00:07
by bobpenas
Hello
I am using the CADEditorControl to load a DXF file and would like help with the following:

1) Disable the user's ability to select entities on the screen with the mouse. In a sense make the CAD drawing read only.
2) After adding a Line or Arc programmatically, how can I do a Zoom All?

Thanks,
Bob

Re: CADEditorControl Help

Posted: 18 Jan 2016, 10:25
by support
Hello Bob,

1) To make a CAD drawing loaded in the CADEditorControl read-only, use the following code:

Code: Select all

cadEditorControl.Image.SelectionMode = CADImport.SelectionEntityMode.Disabled;
2) There are two ways to zoom to the all entities in CADEditorControl:

- Using a Fit drawing to window button on the CADEditorControl toolbar;
- Programmatically, using a CADEditorControl.CalculateNewSizeImage method.


Mikhail

Re: CADEditorControl Help

Posted: 18 Jan 2016, 18:09
by bobpenas
Hi,
1) Works good.
2) The CADEditorControl.CalculateNewSizeImage method only zooms in on the original DXF drawing and does not include any lines or arcs that were added. Here is how I am adding an arc to the drawing. Should I be doing something different?

private void button3_Click(object sender, EventArgs e)
{
CADArc vArc = new CADArc();
vArc.StartAngle = 60;
vArc.EndAngle = 210;
vArc.Radius = 50;
vArc.Point = new DPoint(110, 160, 0);
vArc.Color = Color.Green;
if (cadEditorControl1.Image != null)
{
cadEditorControl1.Image.Converter.Loads(vArc);
cadEditorControl1.Image.Layouts[0].AddEntity(vArc);
cadEditorControl1.Refresh();
}
}

Thanks,
Bob

Re: CADEditorControl Help

Posted: 18 Jan 2016, 22:54
by support
bobpenas wrote:The CADEditorControl.CalculateNewSizeImage method only zooms in on the original DXF drawing and does not include any lines or arcs that were added.
This issue has been solved, we can provide you with an updated CADImport.dll build. Please send a request to the Technical Support e-mail to receive the update.


Mikhail