如何剪切图形?
C#开发|冯美娟|2018-07-24 15:21
-
回答:
private void CutDwgFun() { MxDrawUtility mxUtility = new MxDrawUtility(); MxDrawPoint pt = (MxDrawPoint)(mxUtility.GetPoint(null,"\n 输入剪切矩形框左下角点:")); if (pt == null) { MessageBox.Show("用户取消.."); return; } MxDrawResbuf param = new MxDrawResbuf(); param.AddDouble(pt.x); param.AddDouble(pt.y); MxDrawResbuf retParam = (MxDrawResbuf)axMxDrawX1.CallEx("Mx_GetCorner", param); if(retParam.AtString(0) == "Ok") { SaveFileDialog sfd = new SaveFileDialog(); sfd.Filter = "dwg 文件(*.dwg)|*.dwg"; if (sfd.ShowDialog() != DialogResult.OK) { return; } MxDrawResbuf param2 = new MxDrawResbuf(); param2.AddDouble(retParam.AtDouble(1)); param2.AddDouble(retParam.AtDouble(2)); param2.AddDouble(pt.x); param2.AddDouble(pt.y); param2.AddString(sfd.FileName); MxDrawResbuf ret; ret = (MxDrawResbuf)axMxDrawX1.CallEx("ExApp_CutDwg", param2); if(ret.AtString(0) == "Ok") { MessageBox.Show("剪切成功"); } else { MessageBox.Show("剪切失败"); } } }