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. 基于JS实现发送短信验证码后的倒计时功能(无视页面刷新,页面关闭不进行倒计时功能)

    <!doctype html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  2. 存储过程不返回记录集导致ADO程序出错

    HRESULT _hr = get_adoEOF(&_result); IsEOF()函数如下:其中ADOCG::_RecordsetPtr m_pRecordset; BOOL IsEOF( ...

  3. VR资源浏览网站

    https://my.matterport.com 资源 https://my.matterport.com/show/?m=kCeVCzCjQ5s

  4. 第一章 Spring.Net介绍

    1.1 概述 在Java社区中Spring经历的长时间的考验,已经是一套很成熟稳定的框架.而Spring.Net 的前身是 Java版的Spring.Spring.Net是以Java版的Spring框 ...

  5. Windows之Xmanager连接linux打开Oracle视图操作

    前提:安装Xmanager 能够百度Xmanager下载其破解版或者带注冊机的版本号,也能够官网下载.只是须要秘钥(建议下载企业版) 官网下载地址:http://www.netsarang.com/d ...

  6. BZOJ 1089 SCOI2003 严格n元树 动态规划+高精度

    题目大意:定义一棵深度为d的严格n元树为根的深度为0,最深的节点深度为d,且每一个非叶节点都有恰好n个子节点的树 给定n和d,求深度为d的严格n元树一共同拥有多少种 此题的递推部分并不难 首先我们设深 ...

  7. day13<常见对象+>

    常见对象(StringBuffer类的概述) 常见对象(StringBuffer类的构造方法) 常见对象(StringBuffer的添加功能) 常见对象(StringBuffer的删除功能) 常见对象 ...

  8. HDOJ 4276 The Ghost Blows Light

    题意 1. 给定一棵树, 树上节点有 value, 节点之间 travel 有 cost. 给定起始节点和最大 cost, 求解最大 value 思路 1. 寻找最短路径 a. 题目描述中有两句话, ...

  9. asp.net返回值当文件下载问题

    mvc中返回的javascript当做文件下载 解决方案 Response.ContentEncoding = System.Text.Encoding.UTF8;   Response.Conten ...

  10. BigDecimal类(精度计算类)的加减乘除

    BigDecimal类 对于不需要任何准确计算精度的数字可以直接使用float或double,但是如果需要精确计算的结果,则必须使用BigDecimal类,而且使用BigDecimal类也可以进行大数 ...