Xuất chỉ một số lớp với việc thay đổi kích thước
Contents
[
Hide
]Xuất chỉ một số lớp với việc thay đổi kích thước (CADNET-559)
Vấn đề: Làm thế nào để xuất chỉ một số lớp với việc thay đổi kích thước (CADNET-559).
Mẹo: Để làm điều này, hãy chọn các lớp cần thiết, thêm chúng vào mảng CadBaseEntity, sau đó gán chúng cho các thực thể bản vẽ và thực hiện UpdateSize.
Ví dụ:
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
List<CadBaseEntity> validEntities = new List<CadBaseEntity>(); | |
foreach (CadBaseEntity entity in cadImage.Entities) | |
{ | |
if (entity.LayerName == "Layer1" || entity.LayerName == "Layer2") | |
{ | |
validEntities.Add(entity); | |
} | |
} | |
cadImage.Entities = validEntities.ToArray(); | |
cadImage.UpdateSize(); |