您可以循环访问 和 集合以查找图形中的所有图层和线型。LayersLinetypes 循环访问 Layers 集合下面的代码循环访问集合以收集图形中所有图层的名称。然后,这些名称将显示在消息框中。Layers Sub Ch4_IteratingLayers() Dim layerNames As String Dim entry As AcadLayer layerNames = "" For Each entry In ThisDrawing.Layers layerNames = layerNames + entry.Name + vbCrLf Next MsgBox "The layers in this drawing are: " + vbCrLf + layerNames End Sub 相关概念父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:45
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.