Public Sub ILastToCenter(ByVal AcadApp As Object) '最后绘制的实体居中
Dim sSet As Object
Dim minExt As Variant, maxExt As Variant
For Each sSet In AcadApp.Application.ActiveDocument.SelectionSets
If sSet.Name = "LastEntity" Then sSet.Delete: Exit For
Next
Set sSet = AcadApp.Application.ActiveDocument.SelectionSets.Add("LastEntity")
sSet.Select 4
If sSet.Count = 1 Then
sSet(0).GetBoundingBox minExt, maxExt
AcadApp.Application.ZoomWindow minExt, maxExt
End If
sSet.Delete
End Sub
全部评论