免费视频|新人指南|投诉删帖|广告合作|地信网APP下载

查看: 1564|回复: 2
收起左侧

[求助] 求助,哪位用过GetVolumeAndArea这个函数计算过填方

[复制链接]

1

主题

115

铜板

1

好友

技术员

Rank: 3Rank: 3

积分
23
发表于 2014-4-21 20:21 | 显示全部楼层 |阅读模式
本帖最后由 wyude 于 2014-4-21 20:27 编辑

求助,哪位用过GetVolumeAndArea这个函数计算过填方




tinSurface3.GetVolumeAndArea(pPolygon as IGeometry, height, esriPlaneReferenceType.esriPlaneReferenceBelow, out IsOutsideDataArea, volume, area, proarea);




希望得到指导帮助。程序运行到这里就不继续了,也不报错,而且第四个参数在帮助文档里是ref类型,但是在vs2010里面却是out类型。



我的代码

  1. public override void OnMouseDown(int Button, int Shift, int X, int Y)
  2. {
  3. // TODO: Add Length.OnMouseDown implementation

  4. if (Shift == 1) { MessageBox.Show("Only can choose one graph a time"); return; }
  5. IGraphicsContainer3D pGCT3D = m_sceneHookHelper.Scene.BasicGraphicsLayer as IGraphicsContainer3D;
  6. ISceneGraph pSG = m_sceneHookHelper.SceneGraph;
  7. IPoint pPt;
  8. object pOwner, pObject;
  9. pSG.Locate(pSG.ActiveViewer, X, Y, esriScenePickMode.esriScenePickGraphics, false, out pPt, out pOwner, out pObject);

  10. IElement ele = (IElement)pObject;


  11. if (ele is IPolygonElement)
  12. {
  13. IPolygon pPolygon = ele.Geometry as IPolygon;
  14. double height = pPolygon.FromPoint.Z+1;//pPt.Z;
  15. MessageBox.Show("最高点 "+height);
  16. ITinEdit tinEdit = tin as ITinEdit;
  17. // tinEdit.StartEditing();
  18. ITinSurface3 tinSurface3 = tin as ITinSurface3;
  19. bool IsOutsideDataArea = true;
  20. object volume = Type.Missing;
  21. object area = Type.Missing;
  22. object proarea = Type.Missing;
  23. MessageBox.Show("doubi");
  24. tinSurface3.GetVolumeAndArea(pPolygon as IGeometry, height, esriPlaneReferenceType.esriPlaneReferenceBelow, out IsOutsideDataArea, volume, area, proarea);
  25. MessageBox.Show("doubi2"); MessageBox.Show(Convert.ToString(volume) + Convert.ToString(area));

  26. }
复制代码



发表于 2014-4-22 08:48 | 显示全部楼层
好高级的高教,暂时没用过

评分

参与人数 1铜板 +1 收起 理由
admin + 1 亲,你好快哦~~~

查看全部评分

回复 支持 反对

使用道具 举报

37

主题

2万

铜板

111

好友

钻石会员

Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26Rank: 26

积分
5763
发表于 2022-3-14 20:59 | 显示全部楼层
太高级了,没使用过
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

在线客服
快速回复 返回顶部 返回列表