Public Sub VPCoords(vp As AcadPViewport, ll, ur) Dim min, max, oldMode As Boolean vp.GetBoundingBox min, max oldMode = ThisDrawing.MSpace ThisDrawing.MSpace = True ll = ThisDrawing.Utility.TranslateCoordinates(min, acPaperSpaceDCS, acDisplayDCS, False) ur = ThisDrawing.Utility.TranslateCoordinates(max, acPaperSpaceDCS, acDisplayDCS, False) ThisDrawing.MSpace = oldMode End Sub 这个程序可以实现反图纸中的视口最大点和最小点找出对应模型窗口,你改下就可以直接用了。 |