I have noticed that setting the visibility property to false does not change Insert's visibility, it will change the visibility state of lines.
I am using the FAQ_Demo.Net sample and in the mousedown event I am finding the layer of the entity selected and then I iterate over all the entities in the drawing and if it is on the same layer as the selected entity then I set the visibility property to false.
Can you help me understand why this doesn't work for Inserts but it does work for lines?
I will email you the dwg...
Code: Select all
private void cadPictBox_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
if (this.cadImage == null)
return;
if (e.Button == MouseButtons.Left)
{
if ((this.cadImage.SelectionMode == SelectionEntityMode.Enabled) && useSelectEntity)
{
if (cadImage.Select(e.X, e.Y))
{
CADEntity entity = cadImage.SelectExt(e.X, e.Y, true, false);
string layerName = entity.Layer.Name;
foreach (CADEntity ent in cadImage.Converter.Entities )
{
if (ent.Layer.Name == layerName)
{
ent.Visibility = false;
}
}
cadPictBox.Invalidate(cadImage.GetSelectEntityRegion(this.cadPictBox.ClientRectangle));
}
}
}
else
{
if ((e.Button == MouseButtons.Right) || (e.Button == MouseButtons.Middle))
{
cX = e.X;
cY = e.Y;
detRMouseDown = true;
return;
}
}
if ((!this.clipRectangle.Enabled) && (this.cadImage != null) && (!this.Orb3D.Visible))
this.clipRectangle.EnableRect(RectangleType.Zooming, new Rectangle(e.X, e.Y, 0, 0));
}