AE读取CAD图层包括注记
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图层包括注记的更多相关文章
- AE指定字段转成注记
转自原文 ae指定字段转成注记 ArcMap中有一个功能是Label Features,就是可以将图层内指定字段值显示以Label形式显示在主窗口上,在Label Features后,用右键点击图层, ...
- ArcGIS连带文字注记导出为CAD格式
可以使用ArcGIS的"Export To CAD"工具将点.线.面等要素直接导出为CAD格式.如果要连带将ArcGIS中的文字标注导出为CAD格式要稍麻烦一点,下面是一个例子. ...
- 用IFeatureWorkspaceAnno.CreateAnnotationClass 创建注记图层时报“The application is not licensed to modify or create schema”的错误的解决方案。
用IFeatureWorkspaceAnno.CreateAnnotationClass 的方法创建注记图层的时候报"The application is not licensed to m ...
- arcgis10.2 打开CAD文件注记乱码
1.使用ARCGIS10.2打开CAD文件,图面显示的注记内容为乱码,属性表中的注记内容正常2.同样的CAD文件在ARCGIS9.3中打开正常出现此情况影响历史数据使用,请求ESRI技术支持注:系统添 ...
- 【ESRI论坛6周年征文】ArcEngine注记(Anno/ Label/Element等)处理专题 -入门篇
原发表于ESRI中国社区,转过来.我的社区帐号:jhlong http://bbs.esrichina-bj.cn/ESRI/viewthread.php?tid=122097 ----------- ...
- ArcMap 标注、注记、图形文本
标注.注记.图形文本 2016年8月10日10:29 ArcMap中怎样向地图添加文本,其中标注与注记是重点内容,此处对此进行总结. 参考链接: ①地图文本基本词汇: 什么是文本? ArcGIS 提供 ...
- WebGIS中自定义互联网地图局部注记的一种方案
文章版权由作者李晓晖和博客园共有,若转载请于明显处标明出处:http://www.cnblogs.com/naaoveGIS/ 1. 前言 实际项目中我们经常会遇到这样一种场景:地图底图可能是互 ...
- 【转】Revit二次开发——读取cad中的文字信息
Revit读取cad的文字信息需要借助Teigha的开源dll,在程序中添加下图中红色框的dll文件的引用,其他的dll文件全部放在同一个文件夹中即可,运行的时候,会自动把这些dll文件全部复制到bi ...
- 【ArcEngine入门与提高】Element(元素)、Annotation(注记)旋转
因项目需要,需要做一个旋转注记的工具.因为注记这玩意用的比较少,网上资源也很少,所以做起来相当头疼.在经过一番研究之后,终于搞清楚注记的存储原理了,原来是和Element的类似,只不过注记是要把Ele ...
随机推荐
- C#导出Excel按照指定格式设置单元格属性值
最近项目中一直在写XML.Table.Excel之间的转化.之前一直都是不考虑格式的导出,今天给出一个格式,让按照格式导出,还真把我这新手为难了一翻,网上给出的资料基本一样.为了一个单元格文字变色纠结 ...
- day23<File类递归练习>
File类递归练习(统计该文件夹大小) File类递归练习(删除该文件夹) File类递归练习(拷贝) File类递归练习(按层级打印) 递归练习(斐波那契数列) 递归练习(1000的阶乘所有零和尾部 ...
- 什么是LTE?
LTE是英文Long Term Evolution的缩写.LTE也被通俗的称为3.9G,具有100Mbps的数据下载能力,被视作从3G向4G演进的主流技术.它改进并增强了3G的空中接入技术,采用OFD ...
- 动易CMS漏洞收集
动易SiteWeaver6.8短消息0day跨站漏洞 user用户登陆,默认账号密码 admin/admin888 短消息代码模式下编辑,预览 <img src="../Skin/bl ...
- docker images 详解
docker images 用于查看本地已下载的镜像 [root@localhost ~]$ docker images REPOSITORY TAG IMAGE ID CREATED SIZE ce ...
- 怎样使用es6 export,import不会报错
如果浏览器支持es6的话,需要加上type="module" <script type="module"> import Store from &q ...
- Visual Studio 2013 如何在停止调试Web程序后阻止IIS Express关闭
vs2013 调试项目的时候,当停止调试的时候,端口就被断了.之前以为是IIS那边的控制问题,但是其他并行的项目运行都没有出现这种情况. 最初也没在意,直到现在实在忍受不了了,每次重开也太烦了.就去各 ...
- JS对象添加新的字段
var test={name:"name",age:"12"}; test.id = "12345"; 直接定义添加就成了
- JS中保留小数位数
一.1.2.toFixed(2)
- Sql中将字符串按分割符拆分
创建函数 SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO Create FUNCTION [dbo].[F_Split] ( @SplitString ...