关于擦除或删除对象 (VBA/ActiveX)
您可以使用该方法擦除或删除单个对象。Delete 注意:ActiveX 自动化中的 Collection 对象具有方法,这是由于在类型库中定义这些对象的方式。但是,绝不应删除 Collection 对象,例如 collection、collection 和 collection。如果尝试删除集合,则会导致错误。DeleteModelSpaceLayersDictionaries
创建和删除折线本示例创建轻量级折线,然后将其删除。 Sub Ch4_DeletePolyline() ' Create the polyline Dim lwpolyObj As AcadLWPolyline Dim vertices(0 To 5) As Double vertices(0) = 2: vertices(1) = 4 vertices(2) = 4: vertices(3) = 2 vertices(4) = 6: vertices(5) = 4 Set lwpolyObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(vertices) ZoomAll ' Erase the polyline lwpolyObj.Delete ThisDrawing.Regen acActiveViewport End Sub 父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2024-12-15 20:23
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.