Private Type MyType X As Double Y As Double Z As Double End Type
Sub main() Dim SelP(2) As Double '相当于内部的点 Dim GetP() As MyType '返回的边界定点数组 ReDim GetP(0)
SelP(0) = 250: SelP(1) = 150: SelP(2) = 0 ThisDrawing.SendCommand "-boundary" & vbCr & SelP(0) & "," & SelP(1) & vbCr & vbCr Dim Obj As Object Set Obj = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 1)
Dim i As Integer Dim Data As Variant Data = Obj.Coordinates For i = 0 To (UBound(Data) + 1) / 2 - 1 If i <> 0 Then ReDim Preserve GetP(UBound(GetP) + 1) GetP(UBound(GetP)).X = Data(2 * i) GetP(UBound(GetP)).Y = Data(2 * i + 1) GetP(UBound(GetP)).Z = 0 Next End Sub
|