حذف یک موجودیت
Contents
[
Hide
]چگونه یک موجودیت را حذف کنیم
مسئله: چگونه یک موجودیت را حذف کنیم (CADNET-3).
نکات: برای حذف یک موجودیت، موجودیت مورد نیاز را انتخاب کرده و از روش RemoveEntityAt در طراحی استفاده کنید.
مثال:
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |