如何得到矩形GROUP的四个端点?
我图中有个矩形的GROUP实体,如何通过程序得到这个GROUP的四个端点坐标? 上传一个例图,望高手指教 写了一点,没时间写了,你自己再改改吧.Sub test()<BR> Dim group(0 To 3) As AcadLine<BR> Dim point As Variant<BR> Dim sset As AcadSelectionSet<BR> Dim entry As AcadEntity<BR> Dim i As Integer<BR> ThisDrawing.SendCommand "prompt" & "请选择"<BR> point = ThisDrawing.Utility.GetPoint()<BR> For i = 0 To ThisDrawing.SelectionSets.Count - 1<BR> If ThisDrawing.SelectionSets.Item(i).Name = "ss1" Then ThisDrawing.SelectionSets.Item("ss1").Delete<BR> Next i<BR> Set sset = ThisDrawing.SelectionSets.Add("ss1")<BR> sset.SelectAtPoint point<BR> Set group(0) = sset.Item(0)<BR> Set group(1) = sset.Item(1)<BR> Set group(2) = sset.Item(2)<BR> Set group(3) = sset.Item(3)<BR> Dim pos(0 To 7) As Variant<BR> pos(0) = group(0).StartPoint<BR> pos(1) = group(1).StartPoint<BR> pos(2) = group(2).StartPoint<BR> pos(3) = group(3).StartPoint<BR> MsgBox pos(0)(0) & " " & pos(0)(1) & " " & pos(0)(2) & vbCrLf & pos(1)(0) & " " & pos(1)(1) & " " & pos(1)(2) & vbCrLf & pos(2)(0) & " " & pos(2)(1) & " " & pos(2)(2) & vbCrLf & pos(3)(0) & " " & pos(3)(1) & " " & pos(3)(2)<BR> ThisDrawing.SelectionSets.Item("ss1").Delete<BR>End Sub 谢谢老大。非常感谢,我改改
页:
[1]