本文主要是介绍Civil 3d中 三角网曲面求取二维和三维面积,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
直接来点源码:
public void CreateTinSurfaceArea()
{
try
{
string strErr = "";
ObjectId sId = PromptOptionsHelper.GetPromptEntOptions("请选择曲面", typeof(Autodesk.Civil.DatabaseServices.Surface));
if (sId == new ObjectId())
{
strErr = "用户取消操作!";
return;
}
using (Transaction ts = Autodesk.AutoCAD.ApplicationServices.Application
.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction())
{
//获取曲面对象
Autodesk.Civil.DatabaseServices.TinSurface surface = ts.GetObject(sId, OpenMode.ForRead) as Autodesk.Civil.DatabaseServices.TinSurface;
TerrainSurfaceProperties aaa = surface.GetTerrainProperties();
//平面面积
double d2dAea = aaa.SurfaceArea2D;
//三维面积
double d3dAea = aaa.SurfaceArea3D;
}
}
catch (System.Exception ex)
{
EntBaseOperator.WriteLineInCommand(ex.ToString());
return;
}
}
d2dAea 和 d3dAea 可以用数据来验证,准确无误,大胆放心使用
这篇关于Civil 3d中 三角网曲面求取二维和三维面积的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!