请问Coordinates可以更改一组坐标值吗?我看vba帮助里说只能改一个坐标值,但我写了程序怎么能一次改好多坐标值啊?不知道有没有问题 Sub LWPolyLineCoors() On Error Resume Next ThisDrawing.SelectionSets("SS1").Delete Dim sSet As AcadSelectionSet Dim objLWPolyLine As AcadLWPolyline Dim FilterType(0) As Integer Dim FilterData(0) As Variant FilterType(0) = 0 FilterData(0) = "LWPolyLine" Set sSet = ThisDrawing.SelectionSets.Add("SS1") sSet.SelectOnScreen FilterType, FilterData Dim oldCoors As Variant Dim newCoors As Variant Dim i As Integer For Each objLWPolyLine In sSet oldCoors = objLWPolyLine.Coordinates For i = 0 To UBound(oldCoors) Step 2 MsgBox "原多义线坐标X=" & oldCoors(i) & " Y=" & oldCoors(i + 1) Next i ReDim Preserve oldCoors(7) oldCoors(0) = 0 oldCoors(1) = 0 oldCoors(2) = 1 oldCoors(3) = 1 oldCoors(4) = 2 oldCoors(5) = 2 oldCoors(6) = 1 oldCoors(7) = 0 objLWPolyLine.Coordinates = oldCoors Next objLWPolyLine ThisDrawing.Regen True sSet.Delete End Sub |