www.mxdraw.com
内容索引主面
前一个向上下一个
MxDrawXCustomFunction::Mx_SearchCloseRegion 方法

根据一点,查找闭合的区域

IDL
static McDbHatch* Mx_SearchCloseRegion(DOUBLE x, DOUBLE y);

例如: C#代码

         MxDrawUiPrPoint getPoint = new MxDrawUiPrPoint();
         getPoint.message = "点取一个点";

         if (getPoint.go() != MCAD_McUiPrStatus.mcOk)
             return;

         MxDrawPoint pt = getPoint.value();

         MxDrawResbuf param = new MxDrawResbuf();
         param.AddDouble(pt.x);
         param.AddDouble(pt.y);

        MxDrawResbuf ret = (MxDrawResbuf)axMxDrawX1.CallEx("Mx_SearchCloseRegion", param);
        if (ret == null)
             return;

        MxDrawHatch hatch = (MxDrawHatch)ret.AtObject(0);

         MxDrawResbuf  pls = hatch.GetPolylines();

         if (pls.Count != 0)
         {

             MxDrawPolyline pl = (MxDrawPolyline)pls.AtObject(0);

             for (int i = 0; i < pl.NumVerts; i++)
             {
                 MxDrawPoint tmp =  pl.GetPointAt(i);

                 MessageBox.Show(tmp.x.ToString());
                 MessageBox.Show(tmp.y.ToString());

             }
         }

     }
Copyright (c) 2010. All rights reserved.
你认为该帮助怎么样? 发送反馈信息!