仅导出部分图层并调整尺寸
Contents
[
Hide
]仅导出部分图层并调整尺寸 (CADNET-559)
问题: 如何仅导出部分图层并调整尺寸 (CADNET-559)。
提示: 要做到这一点,请选择所需的图层,将它们添加到 CadBaseEntity 数组中,然后将它们分配给绘图实体并执行 UpdateSize。
示例:
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(); |