Page 1 of 1
CADEditor Features
Posted: 13 Sep 2016, 00:01
by rtec
Hi,
I am using CADEditorControl in my application,
Is it possible to disable user selection for individual entities in CADEditor Control?
Is there any way to click and select individual entities in a block instead of entire block getting selected?
Thanks
Ravi
Re: CADEditor Features
Posted: 13 Sep 2016, 16:47
by support
Hello Ravi,
Is it possible to disable user selection for individual entities in CADEditor Control?
Do you want to prevent particular entities from being selected or unselect them programmatically? If you want to unselect particular entities, what criteria (CADEntity properties) should be used to filter them out?
Is there any way to click and select individual entities in a block instead of entire block getting selected?
Normally, selection of entities inside a block is done in the
Block editor mode. Unfortunately, the Block editor is not supported in CADEditorControl.
Mikhail
Re: CADEditor Features
Posted: 13 Sep 2016, 17:48
by rtec
HI Mikhail,
"Is it possible to disable user selection for individual entities in CADEditor Control?"
-Ravi
Do you want to prevent particular entities from being selected or unselect them programmatically? If you want to unselect particular entities, what criteria (CADEntity properties) should be used to filter them out?
-Mikhail
I want to import user selected entities(in CADEditorControl) to our application and then disable those entities in CADEditorControl to avoid importing them again, and should also be able to disable entities depending on layer and their type (like poly line, polygon..ect).
-Ravi
Re: CADEditor Features
Posted: 13 Sep 2016, 20:43
by support
Hello Ravi,
The following code snippet shows how to disable some of the selected entities depending on their layer and type by pressing
Ctrl+D in CADEditorControl.
Code: Select all
this.cadEditorControl.EditorCADPictureBox.KeyDown += new KeyEventHandler(cadEditorControl_KeyDown);
...
private void cadEditorControl_KeyDown(object sender, KeyEventArgs e)
{
if ((e.Control == true) && (e.KeyCode == Keys.D))
{
foreach (CADEntity entity in cadEditorControl.Image.SelectedEntities)
{
// Disable the lines and texts on the layer "0"
if ((entity.Layer.Name.Equals("0")) && ((entity.EntType == EntityType.Text) || (entity.EntType == EntityType.Line)))
{
entity.Visibility = false;
cadEditorControl.Image.Converter.Loads(entity);
}
}
// Clear selection
cadEditorControl.Image.Selector.ClearSelection();
cadEditorControl.Image.Selector.ClearSelectCollection();
// Fit the whole CAD image into EditorCADPictureBox area
cadEditorControl.CalculateNewSizeImage();
}
}
Mikhail
Re: CADEditor Features
Posted: 14 Sep 2016, 20:26
by rtec
HI,
I don't want to hide the entities, entities should be visible but not selectable.
Thanks
Ravi
Re: CADEditor Features
Posted: 14 Sep 2016, 20:40
by support
Hello Ravi,
You might try to create a locked layer and place the disabled entities on this layer to prevent them from being selected and modified, but, unfortunately, the locked layers currently are not supported in CAD .NET.
Mikhail