如何缩放实体到视区?
C#开发|冯美娟|2018-07-24 15:06
-
回答:
private void ZoomViewForEntity() { MxDrawUtility mxUtility = new MxDrawUtility(); MxDrawPoint getPt; MxDrawEntity ent = mxUtility.GetEntity(out getPt, "选择实体:"); if (ent == null) return; MxDrawPoint pt1Ob, pt2Ob; ent.GetBoundingBox(out pt1Ob,out pt2Ob); ent.Close(); MxDrawPoint pt1 = (MxDrawPoint)pt1Ob; MxDrawPoint pt2 = (MxDrawPoint)pt2Ob; if(pt1 != null && pt2 != null) { MxDrawApplication app = new MxDrawApplication(); app.ZoomWindow(pt1.x,pt1.y, pt2.x,pt2.y); } }