CAD返回曲线组成的闭合区域面积(com接口c#语言)
IMxDrawCurve::GetArea
返回曲线组成的闭合区域面积,具体详细如下:
| 参数 | 说明 |
|---|---|
|
[out] DOUBLE* pArea |
返回闭合区域面积 |
C#代码计算闭合区域面积:
MxDrawPolyline pl = new MxDrawPolyline(); MxDrawPoint pt1 = new MxDrawPoint(); pt1.x = 10; pt1.y = 10; MxDrawPoint pt2 = new MxDrawPoint(); pt2.x = 20; pt2.y = 20; MxDrawPoint pt3 = new MxDrawPoint(); pt3.x = 30.5; pt3.y = 10; pl.AddVertexAt(pt1); pl.AddVertexAt(pt2); pl.AddVertexAt(pt3); pl.IsClosedStatus = true; double dArea = 0.0; pl.GetArea(out dArea); |
浙公网安备 33010602011771号