|
|
| GeoCommunity Mailing List |
| |
| Mailing List Archives |
| Subject: | Re: [gislist] gislist Digest, Vol 45, Issue 5 |
| Date: |
04/18/2007 01:40:00 PM |
| From: |
Santiago Medina |
|
|
Hi Solomon,
I experienced this problem once, ArcMap not refreshing the actual contents of a just-modified feature class. I am not sure this is your problem, but you may want to try the solution that worked for me.
I got the reference to the feature class by accesing it through the layer (IFeatureLayer interface) instead of opening it from the Workspace. Then I modified the Feature Class (& refreshed display) and everything went well, so I guess you have to use the same feature class object ArcMap has already created in order to make it work.
If this works, you'd better write some code to check if the user has already loaded the GPS_MASTER layer, getting the reference from the Layer inside the document if this is the case.
Hope this helps, Santiago
On 4/18/07, gislist-request@lists.geocomm.com < gislist-request@lists.geocomm.com> wrote: > > Send gislist mailing list submissions to > gislist@lists.geocomm.com > > To subscribe or unsubscribe via the World Wide Web, visit > http://lists.geocomm.com/mailman/listinfo/gislist > or, via email, send a message with subject or body 'help' to > gislist-request@lists.geocomm.com > > You can reach the person managing the list at > gislist-owner@lists.geocomm.com > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of gislist digest..." > > > Today's Topics: > > 1. Display of field alias names (Solomon Pulapkura) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Tue, 17 Apr 2007 15:54:02 -0700 > From: "Solomon Pulapkura" <solomon.roy@gmail.com> > Subject: [gislist] Display of field alias names > To: gislist@lists.geocomm.com > Message-ID: > <1567e66c0704171554h73e6f047vd5b0b46481617dba@mail.gmail.com> > Content-Type: text/plain: charset=ISO-8859-1: format=flowed > > 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_",
|
|

Sponsored by:

For information regarding advertising rates Click Here!
|