ลบเอนทิตี

วิธีการลบเอนทิตี

ปัญหา: วิธีการลบเอนทิตี (CADNET-3).

เคล็ดลับ: เพื่อที่จะลบเอนทิตี ให้เลือกเอนทิตีที่ต้องการและใช้วิธี RemoveEntityAt ในการวาดภาพ.

ตัวอย่าง:

for (int i = 0; i < cadImage.Entities.Length; i++)
{
CadBaseEntity baseEntity = cadImage.Entities[i];
if (baseEntity.GetType() == typeof(CadArc))
{
CadArc arc = (CadArc)baseEntity;
if (arc.CenterPoint.X > 1e10)
{
cadImage.RemoveEntityAt(i);
// OR cadImage.RemoveEntity(baseEntity);
i--;
}
}
}
cadImage.UpdateSize();