你好
我想知道如何擦除图形的一部分(通过VBA)。
要删除的区域在每个图形上始终相同
我想通过windows选择(点1:0,0,0点2:10,15,0)
我尝试使用AcSelectionSetWindow,但这不起作用
谢谢
ps:这是我测试的。我知道垃圾箱里有几行代码,但我保留了所有经过测试的代码行
- Private Sub test()
- Dim ObjSelection As AcadSelectionSet
- Dim ObjetOut As AcadEntity
- Dim Point1(0 To 2) As Double
- Dim Point2(0 To 2) As Double
- Dim Point3(0 To 5) As Double
- 'Data
- Point1(0) = 0#
- Point1(1) = 0#
- Point1(2) = 0#
- Point2(0) = 10#
- Point2(1) = 15#
- Point2(2) = 0#
- Point3(0) = 0#
- Point3(1) = 0#
- Point3(2) = 0#
- Point3(3) = 10#
- Point3(4) = 15#
- Point3(5) = 0#
- On Error Resume Next
- 'set ObjSelection = ThisDrawing.PaperSpace.Item
- '. SelectionSets.Item.SelectByPolygon(acSelectionSetWindowPolygon, Point3)
- ObjSelection.Clear
- Set ObjetOut = ObjSelection.Select acSelectionSetWindow, Point1, Point2
- 'ByPolygon acSelectionSetWindow, Point3
- 'ObjSelection.Select acSelectionSetWindow, Point1, Point2
- 'Set ObjSelection = SelectionSets.Item
- ' objSelection.Clear
- ' Set objObjet = objSelection
- ' objSelection.AddItems objObjets
- ' objSelection.Erase
- 'objSelection.SelectByPolygon(acSelectionSetWindowPolygon, 0,0,0 10,15,0)
- 'Set objselectionset = selectionsetscollection.Add(strCartouche)
- End Sub
|