Export of only some entities
Contents
[
Hide
]Export of only some entities
Issue: How to Export of only some entities (CADNET-561).
Tips: To do this, get all the entities of the image, then you can select all the ones you need by adding them to the list, then assign them to the picture, replacing all the others with them, or delete all but the ones you need.
Example:
This file contains 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
CadBaseEntity[] entities = cadImage.Entities; | |
List<CadBaseEntity> filteredEntities = new List<CadBaseEntity>(); | |
foreach (CadBaseEntity baseEntity in entities) | |
{ | |
if (baseEntity.TypeName == CadEntityTypeName.TEXT) | |
{ | |
filteredEntities.Add(baseEntity); | |
} | |
} | |
cadImage.Entities = filteredEntities.ToArray(); | |
OR | |
CadBaseEntity[] entities = cadImage.Entities; | |
int k = 0; | |
foreach (CadBaseEntity baseEntity in entities) | |
{ | |
if (baseEntity.TypeName != CadEntityTypeName.TEXT) | |
{ | |
cadImage.RemoveEntityAt(k); | |
k--; | |
} | |
k++; | |
} |