- 积分
- 603
- 明经币
- 个
- 注册时间
- 2003-11-12
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
发表于 2004-5-8 09:10:00
|
显示全部楼层
用VBA如何加载?执行命令是:test ?
Public Sub test() Dim ss As AcadSelectionSet Dim i As AcadEntity Set ss = ThisDrawing.ActiveSelectionSet ss.Select acSelectionSetAll ss(0).GetBoundingBox pmin, pmax For Each i In ss i.GetBoundingBox p1, p2 If p1(0) < pmin(0) Then pmin(0) = p1(0) If p1(1) < pmin(1) Then pmin(1) = p1(1) If p2(0) > pmax(0) Then pmax(0) = p2(0) If p2(1) > pmax(1) Then pmax(1) = p2(1) Next i ThisDrawing.SendCommand "_.RECTANG " & pmin(0) & "," & pmin(1) & vbCr & pmax(0) & "," & pmax(1) & vbCr End Sub
| |
|