关闭的图层随图形一起再生,但不显示或打印。 通过关闭图层,可以避免每次解冻图层时重新生成图形。当您打开已关闭的图层时,AutoCAD 会重新绘制该图层上的对象。 要打开和关闭图层,请使用该属性。如果为此属性输入值 TRUE,则图层将处于打开状态。如果输入值 FALSE,则图层将关闭。LayerOn 关闭图层本示例创建一个新图层,向该图层添加一个圆圈,然后关闭该图层,使该圆圈不再可见。 Sub Ch4_LayerInvisible() ' Create a circle Dim circleObj As AcadCircle Dim center(0 To 2) As Double Dim radius As Double center(0) = 2: center(1) = 2: center(2) = 0 radius = 1 Set circleObj = ThisDrawing.ModelSpace.AddCircle(center, radius) ' Create a new layer called "ABC" Dim layerObj As AcadLayer Set layerObj = ThisDrawing.Layers.Add("ABC") ' Assign the circle to the "ABC" layer circleObj.Layer = "ABC" circleObj.Update ' Turn off layer "ABC" layerObj.LayerOn = False ThisDrawing.Regen acActiveViewport End Sub 相关概念父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:07
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.