public override void FillDatabase(Teigha.DatabaseServices.Database pDb)
{
IFeatureClassContainer pFeatureClassContainer = pCADFeatureDataset as IFeatureClassContainer;
IEnumFeatureClass pEnumFeatureClass = pFeatureClassContainer.Classes;
IFeatureClass pFeatureClass = pEnumFeatureClass.Next(); while (pFeatureClass != null)
{
LoadLayer(pFeatureClass, pDb);
Debug.WriteLine(pFeatureClass.FeatureType.ToString() + "-" + pFeatureClass.AliasName + "-" + pFeatureClass.ShapeType.ToString());
pFeatureClass = pEnumFeatureClass.Next();
}
}
private void LoadLayer(IFeatureClass pFeatureClass, Teigha.DatabaseServices.Database pDb)
{ int indx = pFeatureClass.FindField("Layer");
int idxColor = pFeatureClass.FindField("Color");
int idxText = pFeatureClass.FindField("TxtMemo");
int idxHandle = pFeatureClass.FindField("Handle"); pCursor = pFeatureClass.Search(null, false);
IFeature pFeature2 = pCursor.NextFeature();
//写入点线 if (pFeatureClass.FeatureType == esriFeatureType.esriFTCoverageAnnotation)
{
while (pFeature2 != null)
{
string geoName = "C_" + pFeature2.get_Value(indx).ToString();
string sAnnotation = pFeature2.get_Value(idxText).ToString();
IPoint pPoint = pFeature2.Shape as IPoint;
double x = , y = ;
pPoint.QueryCoords(out x, out y);
Point3d pt = new Point3d(x, y, );
addTextEnt(modelSpaceId, pt, pt, sAnnotation, , TextHorizontalMode.TextLeft, TextVerticalMode.TextTop, LayerNames[geoName], ttfStyleId);
pFeature2 = pCursor.NextFeature();
}
}
else
{
if (pFeatureClass.ShapeType == esriGeometryType.esriGeometryPoint)
{
while (pFeature2 != null)
{
IPoint pt = pFeature2.Shape as IPoint;
pFeature2 = pCursor.NextFeature();
}
}
else if (pFeatureClass.ShapeType == esriGeometryType.esriGeometryPolyline)
{
short shtColor = ;
while ((pFeature2 = pCursor.NextFeature()) != null)
{
string geoName = "C_" + pFeature2.get_Value(indx).ToString();
}
}
else if (pFeatureClass.ShapeType == esriGeometryType.esriGeometryPolygon)
{
short shtColor = ;
while ((pFeature2 = pCursor.NextFeature()) != null)
{
string geoName = "C_" + pFeature2.get_Value(indx).ToString();
}
}
}
System.Runtime.InteropServices.Marshal.ReleaseComObject(pCursor);
pCursor = null;
}
}

AE读取CAD图层包括注记的更多相关文章

  1. AE指定字段转成注记

    转自原文 ae指定字段转成注记 ArcMap中有一个功能是Label Features,就是可以将图层内指定字段值显示以Label形式显示在主窗口上,在Label Features后,用右键点击图层, ...

  2. ArcGIS连带文字注记导出为CAD格式

    可以使用ArcGIS的"Export To CAD"工具将点.线.面等要素直接导出为CAD格式.如果要连带将ArcGIS中的文字标注导出为CAD格式要稍麻烦一点,下面是一个例子. ...

  3. 用IFeatureWorkspaceAnno.CreateAnnotationClass 创建注记图层时报“The application is not licensed to modify or create schema”的错误的解决方案。

    用IFeatureWorkspaceAnno.CreateAnnotationClass 的方法创建注记图层的时候报"The application is not licensed to m ...

  4. arcgis10.2 打开CAD文件注记乱码

    1.使用ARCGIS10.2打开CAD文件,图面显示的注记内容为乱码,属性表中的注记内容正常2.同样的CAD文件在ARCGIS9.3中打开正常出现此情况影响历史数据使用,请求ESRI技术支持注:系统添 ...

  5. 【ESRI论坛6周年征文】ArcEngine注记(Anno/ Label/Element等)处理专题 -入门篇

    原发表于ESRI中国社区,转过来.我的社区帐号:jhlong http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=122097 ----------- ...

  6. ArcMap 标注、注记、图形文本

    标注.注记.图形文本 2016年8月10日10:29 ArcMap中怎样向地图添加文本,其中标注与注记是重点内容,此处对此进行总结. 参考链接: ①地图文本基本词汇: 什么是文本? ArcGIS 提供 ...

  7. WebGIS中自定义互联网地图局部注记的一种方案

    文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1.    前言 实际项目中我们经常会遇到这样一种场景:地图底图可能是互 ...

  8. 【转】Revit二次开发——读取cad中的文字信息

    Revit读取cad的文字信息需要借助Teigha的开源dll,在程序中添加下图中红色框的dll文件的引用,其他的dll文件全部放在同一个文件夹中即可,运行的时候,会自动把这些dll文件全部复制到bi ...

  9. 【ArcEngine入门与提高】Element(元素)、Annotation(注记)旋转

    因项目需要,需要做一个旋转注记的工具.因为注记这玩意用的比较少,网上资源也很少,所以做起来相当头疼.在经过一番研究之后,终于搞清楚注记的存储原理了,原来是和Element的类似,只不过注记是要把Ele ...

随机推荐

  1. _variant_t和_bstr_t

    _variant_t和_bstr_t这两个类分别封装并管理VARIANT和BSTR这两种数据类型, VARIANT和BSTR这两种类型是COM中使用的数据类型. 实现_variant_t向int,St ...

  2. error C2065: “m_Pic”: 未声明的标识符

    public: CPicture m_Pic; 要写在头文件里! 而不能是cpp文件的public里!

  3. mysql通过mysql_install_db初始化数据目录时使用--user选项的作用是什么?

    需求描述: mysql数据库通过mysql_install_db初始化数据目录时,使用了--user选项,这里记录下该参数的作用 参数解释: 1.--user的作用:就是以哪个操作系统用户来执行mys ...

  4. 原生js获取元素样式

    摘要: 我们在开发过程中经常会遇到通过js获取或者改变DOM元素的样式,方法有很多,比如:通过更改DOM元素的class.现在我们讨论原生js来获取DOM元素的CSS样式,注意是获取不是设置 在开始之 ...

  5. C语言中do...while(0)的妙用-避免goto

    使用goto的优雅并避免结构的混乱 将要跳转到的语句用do{-}while(0) 包起来就可以. reference #defien N 10 bool Execute() { // 分配资源 int ...

  6. 使用Unity制作的一个望远镜特效,在狙击手游戏中非经常见

    仅仅须要编写一个脚本文件,然后就能随意设置放大缩小的速度.以及程度.

  7. swift学习笔记之--方法

    一.说明 跟oc一样,面向对象,swift重点额方法可以分为2大类: (1)实例方法 oc中为减号方法(对象方法) (2)类型方法 oc中的加号方法(类方法) 二.实例方法 只能是对象调用的方法 代码 ...

  8. 导入google地图

    一直报地图页面的 java.lang.incompatibleclasschangeerror 想来想去,应该是包不兼容的原因,原本以为,在 build.gradle 里面 compileSdkVer ...

  9. docker nginx mysql

    docker run -p 9000:9000 --name myphp -v /docker/www/:/var/www/html/ -v /docker/php/php.ini:/usr/loca ...

  10. (转)关于android设备管理器的一些分析

    转自http://bbs.pediy.com/showthread.php?t=183692 想必很多人都知道轰动一时android木马OBAD,该木马利用android设备管理器的漏洞,当用户激活设 ...