首页 > 其他 > 详细

CAD与GIS转换:注记转换及角度问题

时间:2015-06-05 15:26:54      阅读:445      评论:0      收藏:0      [点我收藏+]

CAD注记旋转方向用的是弧度;

GIS注记旋转方向用的是角度;

二者使用需要转换。

 

示例过程:

一、GIS注记转CAD

1.1获得GIS注记文字、尺寸、角度

IAnnotationFeature pAnnoFeature = pFeature as IAnnotationFeature;
ITextElement pTextElement = pAnnoFeature.Annotation as ITextElement;
string pAnnoText = pTextElement.Text;
double pAnnoSize = pTextElement.Symbol.Size;
 double pAnnoAngle = pTextElement.Symbol.Angle;

1.2 在CAD中插入AcadText

double[] pCenterPoint=new double[3];
pCenterPoint[0] = (pElement.Geometry.Envelope.XMin + pElement.Geometry.Envelope.XMax)/2;
pCenterPoint[1] = (pElement.Geometry.Envelope.YMin + pElement.Geometry.Envelope.YMax) / 2;
pCenterPoint[2] = 0;

AcadText pAcadText = CadModelSpace.AddText(pAnnoText, pCenterPoint, textHeight);

 

1.3从GIS获得注记角度需要转换为弧度

double anlgeReal = pAnnoAngle * Math.PI / 180;
pAcadText.Rotate(pCenterPoint, anlgeReal);

 

CAD与GIS转换:注记转换及角度问题

原文:http://www.cnblogs.com/GISRSMAN/p/4554547.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!