VBA之添加Shape图层
来源:互联网 发布:php兄弟连毕业怎么样 编辑:程序博客网 时间:2024/06/08 12:30
参考DeskTop帮助文档
准备:添加一个Button控件
Tools—>Customize—>Commands tab—> UIControl—>IButtonControl
在该Button的Click事件中添加以下代码:
Dim pWorkspaceFactory As IWorkspaceFactory
Set pWorkspaceFactory = New ShapefileWorkspaceFactory
Dim pWorkSpace As IFeatureWorkspace
'Change ‘e:\street’ to the source location of the shapefile you wish to add
Set pWorkSpace = pWorkspaceFactory.OpenFromFile("e:\street", 0)
Dim pClass As IFeatureClass
'Change polygon to the name of the shapefile you wish to add
Set pClass = pWorkSpace.OpenFeatureClass("polygon")
Dim pLayer As IFeatureLayer
Set pLayer = New FeatureLayer
Set pLayer.FeatureClass = pClass
pLayer.Name = pClass.AliasName
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
pMxDoc.AddLayer pLayer
pMxDoc.ActiveView.PartialRefresh esriViewGeography, pLayer, Nothing
准备:添加一个Button控件
Tools—>Customize—>Commands tab—> UIControl—>IButtonControl
在该Button的Click事件中添加以下代码:
Dim pWorkspaceFactory As IWorkspaceFactory
Set pWorkspaceFactory = New ShapefileWorkspaceFactory
Dim pWorkSpace As IFeatureWorkspace
'Change ‘e:\street’ to the source location of the shapefile you wish to add
Set pWorkSpace = pWorkspaceFactory.OpenFromFile("e:\street", 0)
Dim pClass As IFeatureClass
'Change polygon to the name of the shapefile you wish to add
Set pClass = pWorkSpace.OpenFeatureClass("polygon")
Dim pLayer As IFeatureLayer
Set pLayer = New FeatureLayer
Set pLayer.FeatureClass = pClass
pLayer.Name = pClass.AliasName
Dim pMxDoc As IMxDocument
Set pMxDoc = ThisDocument
pMxDoc.AddLayer pLayer
pMxDoc.ActiveView.PartialRefresh esriViewGeography, pLayer, Nothing
- VBA之添加Shape图层
- 在当前地图窗口添加一个Shape文件为一个图层(VBA)
- mapx 使用layerinfo 添加shape 文件层.(VB)
- MapObjects的二次开发之添加图层
- C#+AE加载shape图层
- 六、tensorflow之添加层。
- 添加标注图层
- 添加图层
- 地图图层添加
- ArcGIS Online Web制图之图层添加
- 使用shape绘制阴影图层阴影效果
- 显示当前Map的所有图层名称(VBA)
- 显示当前Map的所有图层名称(VBA)
- 显示指定图层的所有字段信息(VBA)
- 添加shape文件
- Outlook2010 VBA添加联系人
- tensorflow之神经网络层添加函数
- android动态添加图层
- 工作小记之VBA检测重叠图形
- ArcMap中的VBA之field Calculate
- 在ARCMAP中如何将线自动闭合
- 如何求曲线上任意点到端点的距离
- 距离小于一定数值的点之间连线
- VBA之添加Shape图层
- VBA之计算选中多边形的面积
- VBA之框选图形个数
- 控制网的布设
- 在ArcGIS中如何删除重复的点要素
- WGS84和BJ54坐标转换源程序
- shp-cad互相转(带扩展属性)
- ArcGIS的检查与修复工具
- oracle中获取普通用户密码及更改