Hy公司
我解决了这个问题,但用for。。next不起作用(通过acSelectionSetPrevious)。此代码适用于一次性打断选定的多段线。
- Public Sub MegTör(ByVal objektum As AcadLWPolyline, ByVal Xkoordináta As Double, ByVal Ykoordináta As Double)
- Dim s As AcadSelectionSet
- Dim h As AcadEntity
-
- ThisDrawing.SendCommand Chr(28)
- ThisDrawing.SendCommand Chr(28)
- ThisDrawing.SendCommand "_BREAK" & vbCr
-
- On Error Resume Next
- ThisDrawing.SelectionSets("TempSSet").Delete
- Set s = ThisDrawing.SelectionSets.Add("TempSSet")
-
- Set h = objektum.Copy
- s.AddItems h
- h.Highlight True
-
- ThisDrawing.SelectionSets.Item("TempSSet").Select acSelectionSetPrevious
-
- ThisDrawing.SendCommand Replace(Xkoordináta, ",", ".") & "," & Replace(Ykoordináta, ",", ".") & ",0" & vbCr
- ThisDrawing.SendCommand Replace(Xkoordináta, ",", ".") & "," & Replace(Ykoordináta, ",", ".") & ",0" & vbCr
-
- h.Highlight False
- s.Erase
- s.Delete
- Application.Update
- End Sub
|