Jans的BLOG
Jans的BLOG
在Visio使用UML对ESRI Geodatabase进行建模时,发现ESRI提供的UML语义检查器Semantics Checker总是报错:
This operation requires an ArcInfo or ArcEditor seat.
Use the ArcGIS Desktop Administration Utility to set your seat type.
可是我的License在ArcCatalog或ArcMap里LicenseType明明已经显示为ArcInfo啊,郁闷,在Google里找了找,发现ESRI中国给了下面的解释:

  为什么Visio中应用ArcGIS的语义检查器Semantics Checker始终报错?
编号: 000658 相关产品及版本: ArcInfo Desktop,ArcEditor  8.1-8.3,9.0,9.1 平台: N/A
提交时间: 2005-12-19   修改时间: 2005-12-19 提交人: 王嘉彬
错误描述
Visio中应用ArcGIS的语义检查器Semantics Checker始终会报出“This operation requires an ArcInfo or ArcEditor seat. Use the ArcGIS Desktop Administrator Utility to set your seat type.”的错误来。
导致原因
这是一个众所周知的错误。(大家都明白呗)
解决办法
在ArcCatalog中来运行Semantics Checker。
1.启动ArcCatalog.
2.点击菜单“工具”->“定制”->“命令”
3.选择 UIControls
4.点击 New UIControl.
5.选择 UI Button Control.
6.点击 Create and Edit.
7.当 Visual Basic 编辑窗口打开后,在 ‘Private Sub UIButtonControl1_Click()’ 下添加,
umlsemcheck.SemChecker.StartChecker
8.点击菜单“工具”->“引用”,选择 check ESRI UML Semantics Checker.
9.保存
10.关闭Visual Basic 编辑窗口
11.点击菜单“工具”->“定制”->“命令”
12.选择 UIControls
13.从命令窗拖动 new UIControl 到工具条上,现在在ArcCatalog 上UML Semantics Checker 就可以使用了。
虽然可以用了,心里还是不很舒服,因为总要在Visio和ArcCatalog之间切来切去的,实在不爽,因为这个语法检查助手事实上就是一段调用ESRI UML Semantics Checker类库里的一个静态方法,肯定是无法获取正确的License,看看了ArcGIS Develop Kit Help,看到有这么一个例子:
Private Function GetDeploymentName() As String
  
Dim pLicense As IESRILicenseInfo
  
Set pLicense = New ESRILicenseInfo
  
Select Case pLicense.DefaultProduct
  
Case esriProductCodeViewer
    GetDeploymentName 
= "ArcView"
  
Case esriProductCodeEditor
    GetDeploymentName 
= "ArcEditor"
  
Case esriProductCodeProfessional
    GetDeploymentName 
= "ArcInfo"
  
End Select
  MsgBox GetDeploymentName 
End Function
先增加了一个ESRI System Object Library的引用,然后把这段代码放到里面一运行,提示"ArcView",难怪呢.好了,有这个信息就好办了,好了,说干就干,修改你现在Visio工程里的ESRI=>Semantics Checker宏代码如下:(最好把ESRI那个模版也修改一下,这样新的工程就都OK了)
Private Function GetDeploymentName() As String
  
Dim pLicense As IESRILicenseInfo
  
Set pLicense = New ESRILicenseInfo
  
Select Case pLicense.DefaultProduct
  
Case esriProductCodeViewer
    GetDeploymentName 
= "ArcView"
  
Case esriProductCodeEditor
    GetDeploymentName 
= "ArcEditor"
  
Case esriProductCodeProfessional
    GetDeploymentName 
= "ArcInfo"
  
End Select
End Function

Sub Semantics_Checker()
    
If GetDeploymentName() = "ArcView" Then
        
Dim pAo As IAoInitialize
        
Set pAo = New AoInitialize
        pAo.Initialize esriLicenseProductCodeArcInfo
        pAo.Shutdown
    
End If
    StartChecker
End Sub

本人QQ1283205,欢迎大家交流,一起提高。
posted on 2006-11-10 13:00  Jans  阅读(1812)  评论(6编辑  收藏  举报