Howto: 怎么样使用ISpatialReferenceFactory::CreatePredefinedProjections方法?

文章编号: 367
软件: ArcInfo Desktop 8.x,ArcEditor 8.x,ArcView 8.x
操作系统: N/A
已邀请:

易智瑞技术支持

赞同来自:

摘要: 这个文档显示怎么样生成一系列在ArcGIS中可用的预定义的投影,是使用Visual Basic Editor来完成的。
内容: 1 打开ArcMap, 并打开Visual Basic Editor.
2 在工程浏览窗口,展开Project.mxt,选择ArcMap Objects>ThisDocument,右键并选择浏览代码。
在工程的ThisDocument代码模块中的代码将仅仅在现在的地图文档中使用。如果想存储你的代码在你的所有的地图文档中,那么使用Normal.mxt中的ThisDocument代码模块。
3 粘贴下面的代码到代码模块中:

Sub ListProjections()
Dim pSRFactory As ISpatialReferenceFactory
Set pSRFactory = New SpatialReferenceEnvironment
Dim pPCSList As esriCore.ISet
Set pPCSList = pSRFactory.CreatePredefinedProjections
Dim pProj As IProjection
Set pProj = pPCSList.Next '可以循环得到ArcGIS中可用的预定义的所有投影。
Do Until pProj Is Nothing
Debug.Print pProj.Name
Debug.Print pProj.FactoryCode
Set pProj = pPCSList.Next
Loop
End Sub
4 关闭Visual Basic Editor并运行测试代码。
注意:只要把代码中的esriCore.ISet改为ISet,也就可以在9.0的环境中使用。




创建时间:2004-11-02
最近更新:2004-11-02


原文链接
http://support.esrichina.com.cn/2004/1102/367.html

要回复问题请先登录注册