private void DoSplitCurves() { MxDrawUtility mxUtility = new MxDrawUtility(); object getPt; MxDrawEntity ent = mxUtility.GetEntity(out getPt, "选择打断的曲线:" ); if (ent == null ) return ; MxDrawCurve curve; if (ent is MxDrawCurve) { curve = (MxDrawCurve)ent; } else { MessageBox.Show( "实体类型不对" ); return ; } MxDrawPoint getPt1 = (MxDrawPoint)(mxUtility.GetPoint( null , "点取打断位置:" )); if (getPt1 == null ) { MessageBox.Show( "用户取消.." ); return ; } MxDrawResbuf param = new MxDrawResbuf(); param.AddPoint(getPt1, -10); object objId; if (curve.SplitCurves(param,out objId)) { MxDrawResbuf rbId = (MxDrawResbuf)objId; MessageBox.Show( "打断成功,生成的曲线个数:" + rbId.Count); // 把以前的删除掉。 ent.Erase(); } else { MessageBox.Show( "打断失败" ); } } |