Bỏ qua một số thực thể khi xuất
Contents
[
Hide
]Cách bỏ qua một số thực thể khi xuất
Vấn đề: Cách để bỏ qua một số thực thể khi xuất.
Mẹo: Để làm điều này, bạn có thể chọn chỉ những thực thể bạn cần bằng cách thêm chúng vào một danh sách mới và sau đó gán chúng cho bản vẽ.
Ví dụ:
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
using CadImage cadImage = (CadImage)Image.Load(fileName); | |
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(); |