CAD interrupted curve (web version)

The main use of Function:

IMxDrawCurve::SplitCurves

Interrupted curve, described in detail below:

parameter Explanation

[in] IMxDrawResbuf* aryParam

Points parameter array group interrupted position, or interrupted, a target MxDrawResbuf

[out] IMxDrawResbuf** aryNewId

Id new curve generated after interrupt return, the object is MxDrawResbuf

js code interrupted curve to achieve the following:

     var  ent = mxOcx.GetEntity( "选择打断的曲线:" );
     if  (ent ==  null )
         return ;
     
     var  curve;
     if  (ent.ObjectName ==  "McDbSpline" )
     {
         curve =ent;
     }
 
     else
     {
         alert( "实体类型不对" );
         return ;
     }
          
     var  getPt1 = mxOcx.GetPoint( false ,0,0, "\n 点取打断位置:" );
            
     if  (getPt1 ==  null )
     {
         alert( "用户取消.." );
         return ;
     }
     var  param = mxOcx.NewResbuf();
     param.AddPoint(getPt1);
     var  objId = mxOcx.NewResbuf();
          
     if  (curve.SplitCurves(param ,objId))
     {
         var  rbId = objId;
         alert( "打断成功" );
         // 把以前的删除掉。
         ent.Erase();
     }
     else
     {
         alert( "打断失败" );
     }

 

Guess you like

Origin www.cnblogs.com/yzy0224/p/11126003.html