|
|
| GeoCommunity Mailing List |
| |
| Mailing List Archives |
| Subject: | [gislist] Display of field alias names |
| Date: |
04/17/2007 05:55:00 PM |
| From: |
Solomon Pulapkura |
|
|
Hi all, I have programmatically been able to change the alias names of fields of a feature class in SDE using IClassSchemaEdit. But when I use the identify tool, the names dont appear as changed. I have to actually remove the feature class from the TOC and then add it again in ArcMap. Then the changed alias names are visible when I identify a feature. pMxDoc.UpdateContentsalso does not do the trick. Can anyone suggest a workaround? I've attached bits of the code...not the entire one..only relevant parts. So dont be confused if something you think should be there is not there. The code works. Code
Dim pClassSchemaEdit As IClassSchemaEdit Dim pLayer As ILayer Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pTableFields As ITableFields
Public Sub openFC()
Dim pPropertySet As IPropertySet Set pPropertySet = New PropertySet
With pPropertySet .SetProperty "Server", "viper" .SetProperty "Instance", "esri_sde" .SetProperty "user", "public_works" .SetProperty "password", "public_works" .SetProperty "version", "sde.DEFAULT" End With
Dim pWrkspcFactory As IWorkspaceFactory Dim pWrkspc As IWorkspace
Set pWrkspcFactory = New SdeWorkspaceFactory Set pWrkspc = pWrkspcFactory.Open(pPropertySet, hWnd)
Dim pFeatWrkspc As IFeatureWorkspace Set pFeatWrkspc = pWrkspc
Dim pGPSFClass As IFeatureClass Set pGPSFClass = pFeatWrkspc.OpenFeatureClass("PUBLIC_WORKS.GPS_MASTER")
Dim pOClass As IObjectClass Set pOClass = pGPSFClass
Set pSchemaLock = pOClass
Set pClassSchemaEdit = pOClass
End Sub
'Signs If GPSLayersListBox.Text = "Signs" Then
Call openFC
pSchemaLock.ChangeSchemaLock esriExclusiveSchemaLock
'change aliases for signs layer pClassSchemaEdit.AlterFieldAliasName "X", "X Coordinate" pClassSchemaEdit.AlterFieldAliasName "Y", "Y Coordinate" pClassSchemaEdit.AlterFieldAliasName "FCODE", "Feature Code" pClassSchemaEdit.AlterFieldAliasName "HANSEN_NUM", "Hansen Project Number" pClassSchemaEdit.AlterFieldAliasName "MUTCD_NUM", "MUTCD Number" pClassSchemaEdit.AlterFieldAliasName "BGCOLOR", "Background Color" pClassSchemaEdit.AlterFieldAliasName "FGCOLOR", "Foreground Color" pClassSchemaEdit.AlterFieldAliasName "SIZE_", "SIZE" pClassSchemaEdit.AlterFieldAliasName "DESCP_COND", "Condition"
pSchemaLock.ChangeSchemaLock esriSharedSchemaLock
End If _______________________________________________ gislist mailing list gislist@lists.geocomm.com http://lists.geocomm.com/mailman/listinfo/gislist
_________________________________ This list is brought to you by The GeoCommunity http://www.geocomm.com/
|
|

Sponsored by:

For information regarding advertising rates Click Here!
|