www.mxdraw.com
|
根据一点,查找闭合的区域
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()); } } }