Dear All
I need to delete an existing feature class from the ArcCatalog. The script
run successfully, however when I refresh the Contents view in the ArcCatalog
the feature class.
Below the script I wrote.
Public Sub DeleteFeatureClass(FeatureClassName As String)
Dim gxObj As IGxObject
Dim gxObjChild As IGxObject
Dim gxApp As IGxApplication
Dim EnmLyrs As IEnumLayer
Dim LyrFact As ILayerFactory
Dim gxDB As IGxDatabase
Dim gxObjCont As IGxObjectContainer
Dim EnmGxObj As IEnumGxObject
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
Debug.Print gxObj.BaseName
Set gxDB = gxObj
Set gxObjCont = gxDB
Set EnmGxObj = gxObjCont.Children
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = "AAA" Then
gxObjCont.DeleteChild gxObjChild
'gxObjCont.AreChildrenViewable
'Set gxObjChild = Nothing
Set gxCat = gxDB
gxCat.ObjectDeleted gxObjChild
Exit Sub
Else
Set gxObjChild = EnmGxObj.Next
End If
Loop
End Sub
Can any one help me to know how I can delete the feature class correctly?
Regards
Ahmed Samir
GIS Developer
Integral Consult
Ring Road,Maadi
Cairo - Egypt
Tel.: +20 2 5204500
Fax: +20 2 5204505
Email: [email protected]
[Non-text portions of this message have been removed]
Re: [GIS-Cafe] ArcCatalog
Hi Ahmed,
I have made a small modification in your code and
looks like it works. I am using ArcGIS 9.1 and I have
to specify the main esri library before the classes'
names(Forexample esriCatalog.IGxObject), but should
not make a differnce if you do not get compiler error.
Note that you do not see the deleted object class when
you refresh the ArcCatalog but if you close the
ArcCatalog and reopen it again you will see the
deleted object class because you only remove it from
you application not from your geodatabase. let me know
if you want to remove the object class from your
geodatabase permenantly.
Hope this helps,
Farhad
Public Sub DeleteFeatureClass(FeatureClassName As
String)
Dim gxObj As esriCatalog.IGxObject
Dim gxObjChild As esriCatalog.IGxObject
Dim gxApp As esriCatalogUI.IGxApplication
Dim EnmLyrs As IEnumLayer
Dim LyrFact As ILayerFactory
Dim gxDB As esriCatalog.IGxDatabase
Dim gxObjCont As esriCatalog.IGxObjectContainer
Dim EnmGxObj As esriCatalog.IEnumGxObject
Dim gxCat As esriCatalog.GxCatalog
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
msgbox gxObj.BaseName
'followings are the changes:
'******************************************************
'''''Set gxDB = gxObj
Set gxObjCont = gxObj
Set EnmGxObj = gxObjCont.Children
EnmGxObj.Reset
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = FeatureClassName Then
gxObjCont.DeleteChild gxObjChild
''''gxObjCont.AreChildrenViewable
''''Set gxObjChild = Nothing
''''Set gxCat = gxDB
''''gxCat.ObjectDeleted gxObjChild
Exit Sub
'******************************************************
Else
Set gxObjChild = EnmGxObj.Next
End If
Loop
End Sub
'
'
'Calling the procidure(you can do it other ways base
on your app 'requirements
Private Sub UIButtonControl1_Click()
DeleteFeatureClass "point"
End Sub
--- Ahmed Samir wrote:
>
>
> Dear All
>
>
>
> I need to delete an existing feature class from the
> ArcCatalog. The script
> run successfully, however when I refresh the
> Contents view in the ArcCatalog
> the feature class.
>
> Below the script I wrote.
>
>
>
>
>
> Public Sub DeleteFeatureClass(FeatureClassName As
> String)
>
>
>
> Dim gxObj As IGxObject
>
> Dim gxObjChild As IGxObject
>
> Dim gxApp As IGxApplication
>
> Dim EnmLyrs As IEnumLayer
>
> Dim LyrFact As ILayerFactory
>
> Dim gxDB As IGxDatabase
>
> Dim gxObjCont As IGxObjectContainer
>
> Dim EnmGxObj As IEnumGxObject
>
>
>
> Set gxApp = Application
>
> Set gxObj = gxApp.SelectedObject
>
> Debug.Print gxObj.BaseName
>
> Set gxDB = gxObj
>
> Set gxObjCont = gxDB
>
> Set EnmGxObj = gxObjCont.Children
>
> Set gxObjChild = EnmGxObj.Next
>
> Do Until gxObjChild Is Nothing
>
> If gxObjChild.BaseName = "AAA" Then
>
> gxObjCont.DeleteChild gxObjChild
>
> 'gxObjCont.AreChildrenViewable
>
> 'Set gxObjChild = Nothing
>
> Set gxCat = gxDB
>
> gxCat.ObjectDeleted gxObjChild
>
> Exit Sub
>
> Else
>
> Set gxObjChild = EnmGxObj.Next
>
> End If
>
> Loop
>
>
>
> End Sub
>
>
>
> Can any one help me to know how I can delete the
> feature class correctly?
>
>
>
> Regards
>
>
>
> Ahmed Samir
>
> GIS Developer
>
> Integral Consult
>
> Ring Road,Maadi
>
> Cairo - Egypt
>
> Tel.: +20 2 5204500
>
> Fax: +20 2 5204505
>
> Email: [email protected]
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been
> removed]
>
>
>
>
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
RE: [GIS-Cafe] ArcCatalog
Dear Sir
I want to remove the Feature Class from the Geodatabase Permanently
I hope that any one can help me
Ahmed Samir
GIS Developer
Integral Consult
Ring Road,Maadi
Cairo - Egypt
Tel.: +20 2 5204500
Fax: +20 2 5204505
Email: [email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Farhad Kazemi
Sent: Tuesday, November 15, 2005 8:07 PM
To: [email protected]
Subject: Re: [GIS-Cafe] ArcCatalog
Hi Ahmed,
I have made a small modification in your code and
looks like it works. I am using ArcGIS 9.1 and I have
to specify the main esri library before the classes'
names(Forexample esriCatalog.IGxObject), but should
not make a differnce if you do not get compiler error.
Note that you do not see the deleted object class when
you refresh the ArcCatalog but if you close the
ArcCatalog and reopen it again you will see the
deleted object class because you only remove it from
you application not from your geodatabase. let me know
if you want to remove the object class from your
geodatabase permenantly.
Hope this helps,
Farhad
Public Sub DeleteFeatureClass(FeatureClassName As
String)
Dim gxObj As esriCatalog.IGxObject
Dim gxObjChild As esriCatalog.IGxObject
Dim gxApp As esriCatalogUI.IGxApplication
Dim EnmLyrs As IEnumLayer
Dim LyrFact As ILayerFactory
Dim gxDB As esriCatalog.IGxDatabase
Dim gxObjCont As esriCatalog.IGxObjectContainer
Dim EnmGxObj As esriCatalog.IEnumGxObject
Dim gxCat As esriCatalog.GxCatalog
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
msgbox gxObj.BaseName
'followings are the changes:
'******************************************************
'''''Set gxDB = gxObj
Set gxObjCont = gxObj
Set EnmGxObj = gxObjCont.Children
EnmGxObj.Reset
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = FeatureClassName Then
gxObjCont.DeleteChild gxObjChild
''''gxObjCont.AreChildrenViewable
''''Set gxObjChild = Nothing
''''Set gxCat = gxDB
''''gxCat.ObjectDeleted gxObjChild
Exit Sub
'******************************************************
Else
Set gxObjChild = EnmGxObj.Next
End If
Loop
End Sub
'
'
'Calling the procidure(you can do it other ways base
on your app 'requirements
Private Sub UIButtonControl1_Click()
DeleteFeatureClass "point"
End Sub
--- Ahmed Samir wrote:
>
>
> Dear All
>
>
>
> I need to delete an existing feature class from the
> ArcCatalog. The script
> run successfully, however when I refresh the
> Contents view in the ArcCatalog
> the feature class.
>
> Below the script I wrote.
>
>
>
>
>
> Public Sub DeleteFeatureClass(FeatureClassName As
> String)
>
>
>
> Dim gxObj As IGxObject
>
> Dim gxObjChild As IGxObject
>
> Dim gxApp As IGxApplication
>
> Dim EnmLyrs As IEnumLayer
>
> Dim LyrFact As ILayerFactory
>
> Dim gxDB As IGxDatabase
>
> Dim gxObjCont As IGxObjectContainer
>
> Dim EnmGxObj As IEnumGxObject
>
>
>
> Set gxApp = Application
>
> Set gxObj = gxApp.SelectedObject
>
> Debug.Print gxObj.BaseName
>
> Set gxDB = gxObj
>
> Set gxObjCont = gxDB
>
> Set EnmGxObj = gxObjCont.Children
>
> Set gxObjChild = EnmGxObj.Next
>
> Do Until gxObjChild Is Nothing
>
> If gxObjChild.BaseName = "AAA" Then
>
> gxObjCont.DeleteChild gxObjChild
>
> 'gxObjCont.AreChildrenViewable
>
> 'Set gxObjChild = Nothing
>
> Set gxCat = gxDB
>
> gxCat.ObjectDeleted gxObjChild
>
> Exit Sub
>
> Else
>
> Set gxObjChild = EnmGxObj.Next
>
> End If
>
> Loop
>
>
>
> End Sub
>
>
>
> Can any one help me to know how I can delete the
> feature class correctly?
>
>
>
> Regards
>
>
>
> Ahmed Samir
>
> GIS Developer
>
> Integral Consult
>
> Ring Road,Maadi
>
> Cairo - Egypt
>
> Tel.: +20 2 5204500
>
> Fax: +20 2 5204505
>
> Email: [email protected]
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been
> removed]
>
>
>
>
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
Mideastern Cafe for GISers. Relax, discuss, and benefit!
http://groups.yahoo.com/group/gis-cafe
Yahoo! Groups Links
RE: [GIS-Cafe] ArcCatalog
Dear Ahmed,
You should use the proprties and mehtodes of
IGxApplication interface to delete any items in
ArcCatalog.
Followings are the complete codes you can use to
delete any geodatabase feature permenently. Plaese
modify the name for FeatureclassName and copy and past
it to a macro on your ArcCatalog, then select a folder
or a geodatabase connection and run the codes. Remeber
ArcCatalog does not allow deleting any feature classes
inside a coverage if is being used by other
applications since this action will break the topology
of the coverage, but you can delete the whole coverage
or remove the feature class from connection. Please
send me the exact error message if you get any errors.
you me add a few codes to your macro to select the top
node in the ArcCatalog and search the intire
connections for a specified feature class name.
Hope this helps,
Sallam alaikom,
Farhad
Option Explicit
Dim gxApp As esriCatalogUI.IGxApplication
'Calling procidure
Private Sub UIButtonControl1_Click()
Dim gxObj As esriCatalog.IGxObject
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
MsgBox gxObj.BaseName 'Remove later
DeleteFeatureClass gxObj, "FarhadTest"
End Sub
Public Sub DeleteFeatureClass(gxObj As
esriCatalog.IGxObject, FeatureClassName As String)
Dim gxObjChild As esriCatalog.IGxObject
Dim gxObjCont As esriCatalog.IGxObjectContainer
Dim EnmGxObj As esriCatalog.IEnumGxObject
'MsgBox "gxObjCategory = " & gxObj.Category
Set gxObjCont = gxObj
Set EnmGxObj = gxObjCont.Children
EnmGxObj.Reset
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = FeatureClassName Then
gxApp.Selection.Select gxObjChild, False,
Nothing
MsgBox gxApp.SelectedObject.BaseName
gxApp.DeleteSelection
Exit Sub
End If
'Recursion through the children
'MsgBox "gxChildObj Category = " & gxObjChild.Category
If gxObjChild.Category <> "Shapefile" And _
gxObjChild.Category <> "dBASE Table" And _
gxObjChild.Category <> "" Then
Set gxObjCont = gxObjChild
If gxObjCont.HasChildren Then
DeleteFeatureClass gxObjChild, FeatureClassName
End If
End If
Set gxObjChild = EnmGxObj.Next
Loop
'set all objects to nothing here:
End Sub
--- Ahmed Samir wrote:
> Dear Sir wrote:
>
> I want to remove the Feature Class from the
> Geodatabase Permanently
>
>
> I hope that any one can help me
>
>
> Ahmed Samir
> GIS Developer
> Integral Consult
> Ring Road,Maadi
> Cairo - Egypt
> Tel.: +20 2 5204500
> Fax: +20 2 5204505
> Email: [email protected]
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf
> Of Farhad Kazemi
> Sent: Tuesday, November 15, 2005 8:07 PM
> To: [email protected]
> Subject: Re: [GIS-Cafe] ArcCatalog
>
> Hi Ahmed,
>
> I have made a small modification in your code and
> looks like it works. I am using ArcGIS 9.1 and I
> have
> to specify the main esri library before the classes'
> names(Forexample esriCatalog.IGxObject), but should
> not make a differnce if you do not get compiler
> error.
> Note that you do not see the deleted object class
> when
> you refresh the ArcCatalog but if you close the
> ArcCatalog and reopen it again you will see the
> deleted object class because you only remove it from
> you application not from your geodatabase. let me
> know
> if you want to remove the object class from your
> geodatabase permenantly.
>
>
> Hope this helps,
>
> Farhad
>
> Public Sub DeleteFeatureClass(FeatureClassName As
> String)
>
> Dim gxObj As esriCatalog.IGxObject
> Dim gxObjChild As esriCatalog.IGxObject
> Dim gxApp As esriCatalogUI.IGxApplication
> Dim EnmLyrs As IEnumLayer
> Dim LyrFact As ILayerFactory
> Dim gxDB As esriCatalog.IGxDatabase
> Dim gxObjCont As esriCatalog.IGxObjectContainer
> Dim EnmGxObj As esriCatalog.IEnumGxObject
> Dim gxCat As esriCatalog.GxCatalog
> Set gxApp = Application
> Set gxObj = gxApp.SelectedObject
>
> msgbox gxObj.BaseName
> 'followings are the changes:
>
'******************************************************
> '''''Set gxDB = gxObj
> Set gxObjCont = gxObj
> Set EnmGxObj = gxObjCont.Children
> EnmGxObj.Reset
> Set gxObjChild = EnmGxObj.Next
> Do Until gxObjChild Is Nothing
> If gxObjChild.BaseName = FeatureClassName
> Then
> gxObjCont.DeleteChild gxObjChild
> ''''gxObjCont.AreChildrenViewable
> ''''Set gxObjChild = Nothing
> ''''Set gxCat = gxDB
> ''''gxCat.ObjectDeleted gxObjChild
>
> Exit Sub
>
'******************************************************
> Else
>
> Set gxObjChild = EnmGxObj.Next
>
> End If
>
> Loop
>
>
>
> End Sub
> '
> '
> 'Calling the procidure(you can do it other ways base
> on your app 'requirements
> Private Sub UIButtonControl1_Click()
> DeleteFeatureClass "point"
> End Sub
>
>
>
> --- Ahmed Samir
>
> >
> >
> > Dear All
> >
> >
> >
> > I need to delete an existing feature class from
> the
> > ArcCatalog. The script
> > run successfully, however when I refresh the
> > Contents view in the ArcCatalog
> > the feature class.
> >
> > Below the script I wrote.
> >
> >
> >
> >
> >
> > Public Sub DeleteFeatureClass(FeatureClassName As
> > String)
> >
> >
> >
> > Dim gxObj As IGxObject
> >
> > Dim gxObjChild As IGxObject
> >
> > Dim gxApp As IGxApplication
> >
> > Dim EnmLyrs As IEnumLayer
> >
> > Dim LyrFact As ILayerFactory
> >
> > Dim gxDB As IGxDatabase
> >
> > Dim gxObjCont As IGxObjectContainer
> >
> > Dim EnmGxObj As IEnumGxObject
> >
> >
> >
> > Set gxApp = Application
> >
> > Set gxObj = gxApp.SelectedObject
> >
> > Debug.Print gxObj.BaseName
> >
> > Set gxDB = gxObj
> >
> > Set gxObjCont = gxDB
> >
> > Set EnmGxObj = gxObjCont.Children
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > Do Until gxObjChild Is Nothing
> >
> > If gxObjChild.BaseName = "AAA" Then
> >
> > gxObjCont.DeleteChild gxObjChild
> >
> > 'gxObjCont.AreChildrenViewable
> >
> > 'Set gxObjChild = Nothing
> >
> > Set gxCat = gxDB
> >
> > gxCat.ObjectDeleted gxObjChild
> >
> > Exit Sub
> >
> > Else
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > End If
> >
> > Loop
> >
> >
> >
> > End Sub
> >
> >
> >
> > Can any one help me to know how I can delete the
> > feature class correctly?
> >
> >
> >
> > Regards
> >
>
=== message truncated ===
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
Re: ArcCatalog
Dear Ahmed,
You should work on "IWorkspace", then get hold to the datasets
in the desird workspace using "IEnumDataset", queryinterface the
dataset with the featureclass, & finally delete.
The following code deletes empty tables in a Geodatabase:
--------------------------------------------------------------
Private Sub UIBtnCntrDel_Click()
Dim pWSpaceFactory As IWorkspaceFactory
Dim pworkspace As IWorkspace
Dim pEnumDatasets As IEnumDataset
Dim pDataset As IDataset
Dim pFeatclass As IFeatureClass
Dim ptable As ITable
Dim pQueryfilter As IQueryFilter
Set pWSpaceFactory = New AccessWorkspaceFactory
Set pworkspace = pWSpaceFactory.OpenFromFile("E:\DB_Handling\" &
f2.Name & "\" & f1.Name, 0)
Set pEnumDatasets = pworkspace.Datasets(esriDTTable)
Set pDataset = pEnumDatasets.Next
Set pQueryfilter = New QueryFilter
Do Until pDataset Is Nothing
'MsgBox (pDataset.Name)
Set ptable = pDataset
If ptable.RowCount(Nothing) = 0 Then
Set pDataset = ptable
pDataset.Delete
End If
Set pDataset = pEnumDatasets.Next
Loop
End Sub
--- In [email protected], Farhad Kazemi wrote: wrote:
wrote:
>
> Dear Ahmed,
>
> You should use the proprties and mehtodes of
> IGxApplication interface to delete any items in
> ArcCatalog.
> Followings are the complete codes you can use to
> delete any geodatabase feature permenently. Plaese
> modify the name for FeatureclassName and copy and past
> it to a macro on your ArcCatalog, then select a folder
> or a geodatabase connection and run the codes. Remeber
> ArcCatalog does not allow deleting any feature classes
> inside a coverage if is being used by other
> applications since this action will break the topology
> of the coverage, but you can delete the whole coverage
> or remove the feature class from connection. Please
> send me the exact error message if you get any errors.
> you me add a few codes to your macro to select the top
> node in the ArcCatalog and search the intire
> connections for a specified feature class name.
>
> Hope this helps,
>
> Sallam alaikom,
>
> Farhad
>
>
> Option Explicit
> Dim gxApp As esriCatalogUI.IGxApplication
>
> 'Calling procidure
> Private Sub UIButtonControl1_Click()
>
> Dim gxObj As esriCatalog.IGxObject
> Set gxApp = Application
> Set gxObj = gxApp.SelectedObject
>
> MsgBox gxObj.BaseName 'Remove later
>
> DeleteFeatureClass gxObj, "FarhadTest"
> End Sub
>
>
> Public Sub DeleteFeatureClass(gxObj As
> esriCatalog.IGxObject, FeatureClassName As String)
>
> Dim gxObjChild As esriCatalog.IGxObject
> Dim gxObjCont As esriCatalog.IGxObjectContainer
> Dim EnmGxObj As esriCatalog.IEnumGxObject
>
> 'MsgBox "gxObjCategory = " & gxObj.Category
>
> Set gxObjCont = gxObj
>
> Set EnmGxObj = gxObjCont.Children
> EnmGxObj.Reset
> Set gxObjChild = EnmGxObj.Next
> Do Until gxObjChild Is Nothing
> If gxObjChild.BaseName = FeatureClassName Then
> gxApp.Selection.Select gxObjChild, False,
> Nothing
>
> MsgBox gxApp.SelectedObject.BaseName
>
> gxApp.DeleteSelection
> Exit Sub
> End If
> 'Recursion through the children
> 'MsgBox "gxChildObj Category = " & gxObjChild.Category
> If gxObjChild.Category <> "Shapefile" And _
> gxObjChild.Category <> "dBASE Table" And _
> gxObjChild.Category <> "" Then
>
> Set gxObjCont = gxObjChild
> If gxObjCont.HasChildren Then
> DeleteFeatureClass gxObjChild, FeatureClassName
> End If
> End If
> Set gxObjChild = EnmGxObj.Next
>
> Loop
> 'set all objects to nothing here:
>
> End Sub
>
>
>
>
>
>
> --- Ahmed Samir
>
> > Dear Sir
> >
> > I want to remove the Feature Class from the
> > Geodatabase Permanently
> >
> >
> > I hope that any one can help me
> >
> >
> > Ahmed Samir
> > GIS Developer
> > Integral Consult
> > Ring Road,Maadi
> > Cairo - Egypt
> > Tel.: +20 2 5204500
> > Fax: +20 2 5204505
> > Email: asamir@i...
> >
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf
> > Of Farhad Kazemi
> > Sent: Tuesday, November 15, 2005 8:07 PM
> > To: [email protected]
> > Subject: Re: [GIS-Cafe] ArcCatalog
> >
> > Hi Ahmed,
> >
> > I have made a small modification in your code and
> > looks like it works. I am using ArcGIS 9.1 and I
> > have
> > to specify the main esri library before the classes'
> > names(Forexample esriCatalog.IGxObject), but should
> > not make a differnce if you do not get compiler
> > error.
> > Note that you do not see the deleted object class
> > when
> > you refresh the ArcCatalog but if you close the
> > ArcCatalog and reopen it again you will see the
> > deleted object class because you only remove it from
> > you application not from your geodatabase. let me
> > know
> > if you want to remove the object class from your
> > geodatabase permenantly.
> >
> >
> > Hope this helps,
> >
> > Farhad
> >
> > Public Sub DeleteFeatureClass(FeatureClassName As
> > String)
> >
> > Dim gxObj As esriCatalog.IGxObject
> > Dim gxObjChild As esriCatalog.IGxObject
> > Dim gxApp As esriCatalogUI.IGxApplication
> > Dim EnmLyrs As IEnumLayer
> > Dim LyrFact As ILayerFactory
> > Dim gxDB As esriCatalog.IGxDatabase
> > Dim gxObjCont As esriCatalog.IGxObjectContainer
> > Dim EnmGxObj As esriCatalog.IEnumGxObject
> > Dim gxCat As esriCatalog.GxCatalog
> > Set gxApp = Application
> > Set gxObj = gxApp.SelectedObject
> >
> > msgbox gxObj.BaseName
> > 'followings are the changes:
> >
> '******************************************************
> > '''''Set gxDB = gxObj
> > Set gxObjCont = gxObj
> > Set EnmGxObj = gxObjCont.Children
> > EnmGxObj.Reset
> > Set gxObjChild = EnmGxObj.Next
> > Do Until gxObjChild Is Nothing
> > If gxObjChild.BaseName = FeatureClassName
> > Then
> > gxObjCont.DeleteChild gxObjChild
> > ''''gxObjCont.AreChildrenViewable
> > ''''Set gxObjChild = Nothing
> > ''''Set gxCat = gxDB
> > ''''gxCat.ObjectDeleted gxObjChild
> >
> > Exit Sub
> >
> '******************************************************
> > Else
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > End If
> >
> > Loop
> >
> >
> >
> > End Sub
> > '
> > '
> > 'Calling the procidure(you can do it other ways base
> > on your app 'requirements
> > Private Sub UIButtonControl1_Click()
> > DeleteFeatureClass "point"
> > End Sub
> >
> >
> >
> > --- Ahmed Samir
> >
> > >
> > >
> > > Dear All
> > >
> > >
> > >
> > > I need to delete an existing feature class from
> > the
> > > ArcCatalog. The script
> > > run successfully, however when I refresh the
> > > Contents view in the ArcCatalog
> > > the feature class.
> > >
> > > Below the script I wrote.
> > >
> > >
> > >
> > >
> > >
> > > Public Sub DeleteFeatureClass(FeatureClassName As
> > > String)
> > >
> > >
> > >
> > > Dim gxObj As IGxObject
> > >
> > > Dim gxObjChild As IGxObject
> > >
> > > Dim gxApp As IGxApplication
> > >
> > > Dim EnmLyrs As IEnumLayer
> > >
> > > Dim LyrFact As ILayerFactory
> > >
> > > Dim gxDB As IGxDatabase
> > >
> > > Dim gxObjCont As IGxObjectContainer
> > >
> > > Dim EnmGxObj As IEnumGxObject
> > >
> > >
> > >
> > > Set gxApp = Application
> > >
> > > Set gxObj = gxApp.SelectedObject
> > >
> > > Debug.Print gxObj.BaseName
> > >
> > > Set gxDB = gxObj
> > >
> > > Set gxObjCont = gxDB
> > >
> > > Set EnmGxObj = gxObjCont.Children
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > Do Until gxObjChild Is Nothing
> > >
> > > If gxObjChild.BaseName = "AAA" Then
> > >
> > > gxObjCont.DeleteChild gxObjChild
> > >
> > > 'gxObjCont.AreChildrenViewable
> > >
> > > 'Set gxObjChild = Nothing
> > >
> > > Set gxCat = gxDB
> > >
> > > gxCat.ObjectDeleted gxObjChild
> > >
> > > Exit Sub
> > >
> > > Else
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > End If
> > >
> > > Loop
> > >
> > >
> > >
> > > End Sub
> > >
> > >
> > >
> > > Can any one help me to know how I can delete the
> > > feature class correctly?
> > >
> > >
> > >
> > > Regards
> > >
> >
> === message truncated ===
>
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
>
RE: [GIS-Cafe] Re: ArcCatalog
Dear Marwa
Thank you for your efforts
I did it week ago. Your script looks like what I did.
Keep in touch
Ahmed Samir
GIS Developer
Integral Consult
Ring Road,Maadi
Cairo - Egypt
Tel.: +20 2 5204500
Fax: +20 2 5204505
Email: [email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Marwa Abou El Hassan
Sent: Thursday, November 24, 2005 2:10 PM
To: [email protected]
Subject: [GIS-Cafe] Re: ArcCatalog
Dear Ahmed,
You should work on "IWorkspace", then get hold to the datasets
in the desird workspace using "IEnumDataset", queryinterface the
dataset with the featureclass, & finally delete.
The following code deletes empty tables in a Geodatabase:
--------------------------------------------------------------
Private Sub UIBtnCntrDel_Click()
Dim pWSpaceFactory As IWorkspaceFactory
Dim pworkspace As IWorkspace
Dim pEnumDatasets As IEnumDataset
Dim pDataset As IDataset
Dim pFeatclass As IFeatureClass
Dim ptable As ITable
Dim pQueryfilter As IQueryFilter
Set pWSpaceFactory = New AccessWorkspaceFactory
Set pworkspace = pWSpaceFactory.OpenFromFile("E:\DB_Handling\" &
f2.Name & "\" & f1.Name, 0)
Set pEnumDatasets = pworkspace.Datasets(esriDTTable)
Set pDataset = pEnumDatasets.Next
Set pQueryfilter = New QueryFilter
Do Until pDataset Is Nothing
'MsgBox (pDataset.Name)
Set ptable = pDataset
If ptable.RowCount(Nothing) = 0 Then
Set pDataset = ptable
pDataset.Delete
End If
Set pDataset = pEnumDatasets.Next
Loop
End Sub
--- In [email protected], Farhad Kazemi
wrote:
>
> Dear Ahmed,
>
> You should use the proprties and mehtodes of
> IGxApplication interface to delete any items in
> ArcCatalog.
> Followings are the complete codes you can use to
> delete any geodatabase feature permenently. Plaese
> modify the name for FeatureclassName and copy and past
> it to a macro on your ArcCatalog, then select a folder
> or a geodatabase connection and run the codes. Remeber
> ArcCatalog does not allow deleting any feature classes
> inside a coverage if is being used by other
> applications since this action will break the topology
> of the coverage, but you can delete the whole coverage
> or remove the feature class from connection. Please
> send me the exact error message if you get any errors.
> you me add a few codes to your macro to select the top
> node in the ArcCatalog and search the intire
> connections for a specified feature class name.
>
> Hope this helps,
>
> Sallam alaikom,
>
> Farhad
>
>
> Option Explicit
> Dim gxApp As esriCatalogUI.IGxApplication
>
> 'Calling procidure
> Private Sub UIButtonControl1_Click()
>
> Dim gxObj As esriCatalog.IGxObject
> Set gxApp = Application
> Set gxObj = gxApp.SelectedObject
>
> MsgBox gxObj.BaseName 'Remove later
>
> DeleteFeatureClass gxObj, "FarhadTest"
> End Sub
>
>
> Public Sub DeleteFeatureClass(gxObj As
> esriCatalog.IGxObject, FeatureClassName As String)
>
> Dim gxObjChild As esriCatalog.IGxObject
> Dim gxObjCont As esriCatalog.IGxObjectContainer
> Dim EnmGxObj As esriCatalog.IEnumGxObject
>
> 'MsgBox "gxObjCategory = " & gxObj.Category
>
> Set gxObjCont = gxObj
>
> Set EnmGxObj = gxObjCont.Children
> EnmGxObj.Reset
> Set gxObjChild = EnmGxObj.Next
> Do Until gxObjChild Is Nothing
> If gxObjChild.BaseName = FeatureClassName Then
> gxApp.Selection.Select gxObjChild, False,
> Nothing
>
> MsgBox gxApp.SelectedObject.BaseName
>
> gxApp.DeleteSelection
> Exit Sub
> End If
> 'Recursion through the children
> 'MsgBox "gxChildObj Category = " & gxObjChild.Category
> If gxObjChild.Category <> "Shapefile" And _
> gxObjChild.Category <> "dBASE Table" And _
> gxObjChild.Category <> "" Then
>
> Set gxObjCont = gxObjChild
> If gxObjCont.HasChildren Then
> DeleteFeatureClass gxObjChild, FeatureClassName
> End If
> End If
> Set gxObjChild = EnmGxObj.Next
>
> Loop
> 'set all objects to nothing here:
>
> End Sub
>
>
>
>
>
>
> --- Ahmed Samir wrote:
>
> > Dear Sir
> >
> > I want to remove the Feature Class from the
> > Geodatabase Permanently
> >
> >
> > I hope that any one can help me
> >
> >
> > Ahmed Samir
> > GIS Developer
> > Integral Consult
> > Ring Road,Maadi
> > Cairo - Egypt
> > Tel.: +20 2 5204500
> > Fax: +20 2 5204505
> > Email: asamir@i...
> >
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf
> > Of Farhad Kazemi
> > Sent: Tuesday, November 15, 2005 8:07 PM
> > To: [email protected]
> > Subject: Re: [GIS-Cafe] ArcCatalog
> >
> > Hi Ahmed,
> >
> > I have made a small modification in your code and
> > looks like it works. I am using ArcGIS 9.1 and I
> > have
> > to specify the main esri library before the classes'
> > names(Forexample esriCatalog.IGxObject), but should
> > not make a differnce if you do not get compiler
> > error.
> > Note that you do not see the deleted object class
> > when
> > you refresh the ArcCatalog but if you close the
> > ArcCatalog and reopen it again you will see the
> > deleted object class because you only remove it from
> > you application not from your geodatabase. let me
> > know
> > if you want to remove the object class from your
> > geodatabase permenantly.
> >
> >
> > Hope this helps,
> >
> > Farhad
> >
> > Public Sub DeleteFeatureClass(FeatureClassName As
> > String)
> >
> > Dim gxObj As esriCatalog.IGxObject
> > Dim gxObjChild As esriCatalog.IGxObject
> > Dim gxApp As esriCatalogUI.IGxApplication
> > Dim EnmLyrs As IEnumLayer
> > Dim LyrFact As ILayerFactory
> > Dim gxDB As esriCatalog.IGxDatabase
> > Dim gxObjCont As esriCatalog.IGxObjectContainer
> > Dim EnmGxObj As esriCatalog.IEnumGxObject
> > Dim gxCat As esriCatalog.GxCatalog
> > Set gxApp = Application
> > Set gxObj = gxApp.SelectedObject
> >
> > msgbox gxObj.BaseName
> > 'followings are the changes:
> >
> '******************************************************
> > '''''Set gxDB = gxObj
> > Set gxObjCont = gxObj
> > Set EnmGxObj = gxObjCont.Children
> > EnmGxObj.Reset
> > Set gxObjChild = EnmGxObj.Next
> > Do Until gxObjChild Is Nothing
> > If gxObjChild.BaseName = FeatureClassName
> > Then
> > gxObjCont.DeleteChild gxObjChild
> > ''''gxObjCont.AreChildrenViewable
> > ''''Set gxObjChild = Nothing
> > ''''Set gxCat = gxDB
> > ''''gxCat.ObjectDeleted gxObjChild
> >
> > Exit Sub
> >
> '******************************************************
> > Else
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > End If
> >
> > Loop
> >
> >
> >
> > End Sub
> > '
> > '
> > 'Calling the procidure(you can do it other ways base
> > on your app 'requirements
> > Private Sub UIButtonControl1_Click()
> > DeleteFeatureClass "point"
> > End Sub
> >
> >
> >
> > --- Ahmed Samir wrote:
> >
> > >
> > >
> > > Dear All
> > >
> > >
> > >
> > > I need to delete an existing feature class from
> > the
> > > ArcCatalog. The script
> > > run successfully, however when I refresh the
> > > Contents view in the ArcCatalog
> > > the feature class.
> > >
> > > Below the script I wrote.
> > >
> > >
> > >
> > >
> > >
> > > Public Sub DeleteFeatureClass(FeatureClassName As
> > > String)
> > >
> > >
> > >
> > > Dim gxObj As IGxObject
> > >
> > > Dim gxObjChild As IGxObject
> > >
> > > Dim gxApp As IGxApplication
> > >
> > > Dim EnmLyrs As IEnumLayer
> > >
> > > Dim LyrFact As ILayerFactory
> > >
> > > Dim gxDB As IGxDatabase
> > >
> > > Dim gxObjCont As IGxObjectContainer
> > >
> > > Dim EnmGxObj As IEnumGxObject
> > >
> > >
> > >
> > > Set gxApp = Application
> > >
> > > Set gxObj = gxApp.SelectedObject
> > >
> > > Debug.Print gxObj.BaseName
> > >
> > > Set gxDB = gxObj
> > >
> > > Set gxObjCont = gxDB
> > >
> > > Set EnmGxObj = gxObjCont.Children
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > Do Until gxObjChild Is Nothing
> > >
> > > If gxObjChild.BaseName = "AAA" Then
> > >
> > > gxObjCont.DeleteChild gxObjChild
> > >
> > > 'gxObjCont.AreChildrenViewable
> > >
> > > 'Set gxObjChild = Nothing
> > >
> > > Set gxCat = gxDB
> > >
> > > gxCat.ObjectDeleted gxObjChild
> > >
> > > Exit Sub
> > >
> > > Else
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > End If
> > >
> > > Loop
> > >
> > >
> > >
> > > End Sub
> > >
> > >
> > >
> > > Can any one help me to know how I can delete the
> > > feature class correctly?
> > >
> > >
> > >
> > > Regards
> > >
> >
> === message truncated ===
>
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
>
Mideastern Cafe for GISers. Relax, discuss, and benefit!
http://groups.yahoo.com/group/gis-cafe
Yahoo! Groups Links
http://groups.yahoo.com/group/gis-cafe/
[email protected]
http://docs.yahoo.com/info/terms/
[Non-text portions of this message have been removed]
ArcCatalog
Dear All
I need to delete an existing feature class from the ArcCatalog. The script
run successfully, however when I refresh the Contents view in the ArcCatalog
the feature class.
Below the script I wrote.
Public Sub DeleteFeatureClass(FeatureClassName As String)
Dim gxObj As IGxObject
Dim gxObjChild As IGxObject
Dim gxApp As IGxApplication
Dim EnmLyrs As IEnumLayer
Dim LyrFact As ILayerFactory
Dim gxDB As IGxDatabase
Dim gxObjCont As IGxObjectContainer
Dim EnmGxObj As IEnumGxObject
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
Debug.Print gxObj.BaseName
Set gxDB = gxObj
Set gxObjCont = gxDB
Set EnmGxObj = gxObjCont.Children
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = "AAA" Then
gxObjCont.DeleteChild gxObjChild
'gxObjCont.AreChildrenViewable
'Set gxObjChild = Nothing
Set gxCat = gxDB
gxCat.ObjectDeleted gxObjChild
Exit Sub
Else
Set gxObjChild = EnmGxObj.Next
End If
Loop
End Sub
Can any one help me to know how I can delete the feature class correctly?
Regards
Ahmed Samir
GIS Developer
Integral Consult
Ring Road,Maadi
Cairo - Egypt
Tel.: +20 2 5204500
Fax: +20 2 5204505
Email: [email protected]
[Non-text portions of this message have been removed]
Re: [GIS-Cafe] ArcCatalog
Hi Ahmed,
I have made a small modification in your code and
looks like it works. I am using ArcGIS 9.1 and I have
to specify the main esri library before the classes'
names(Forexample esriCatalog.IGxObject), but should
not make a differnce if you do not get compiler error.
Note that you do not see the deleted object class when
you refresh the ArcCatalog but if you close the
ArcCatalog and reopen it again you will see the
deleted object class because you only remove it from
you application not from your geodatabase. let me know
if you want to remove the object class from your
geodatabase permenantly.
Hope this helps,
Farhad
Public Sub DeleteFeatureClass(FeatureClassName As
String)
Dim gxObj As esriCatalog.IGxObject
Dim gxObjChild As esriCatalog.IGxObject
Dim gxApp As esriCatalogUI.IGxApplication
Dim EnmLyrs As IEnumLayer
Dim LyrFact As ILayerFactory
Dim gxDB As esriCatalog.IGxDatabase
Dim gxObjCont As esriCatalog.IGxObjectContainer
Dim EnmGxObj As esriCatalog.IEnumGxObject
Dim gxCat As esriCatalog.GxCatalog
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
msgbox gxObj.BaseName
'followings are the changes:
'******************************************************
'''''Set gxDB = gxObj
Set gxObjCont = gxObj
Set EnmGxObj = gxObjCont.Children
EnmGxObj.Reset
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = FeatureClassName Then
gxObjCont.DeleteChild gxObjChild
''''gxObjCont.AreChildrenViewable
''''Set gxObjChild = Nothing
''''Set gxCat = gxDB
''''gxCat.ObjectDeleted gxObjChild
Exit Sub
'******************************************************
Else
Set gxObjChild = EnmGxObj.Next
End If
Loop
End Sub
'
'
'Calling the procidure(you can do it other ways base
on your app 'requirements
Private Sub UIButtonControl1_Click()
DeleteFeatureClass "point"
End Sub
--- Ahmed Samir wrote:
>
>
> Dear All
>
>
>
> I need to delete an existing feature class from the
> ArcCatalog. The script
> run successfully, however when I refresh the
> Contents view in the ArcCatalog
> the feature class.
>
> Below the script I wrote.
>
>
>
>
>
> Public Sub DeleteFeatureClass(FeatureClassName As
> String)
>
>
>
> Dim gxObj As IGxObject
>
> Dim gxObjChild As IGxObject
>
> Dim gxApp As IGxApplication
>
> Dim EnmLyrs As IEnumLayer
>
> Dim LyrFact As ILayerFactory
>
> Dim gxDB As IGxDatabase
>
> Dim gxObjCont As IGxObjectContainer
>
> Dim EnmGxObj As IEnumGxObject
>
>
>
> Set gxApp = Application
>
> Set gxObj = gxApp.SelectedObject
>
> Debug.Print gxObj.BaseName
>
> Set gxDB = gxObj
>
> Set gxObjCont = gxDB
>
> Set EnmGxObj = gxObjCont.Children
>
> Set gxObjChild = EnmGxObj.Next
>
> Do Until gxObjChild Is Nothing
>
> If gxObjChild.BaseName = "AAA" Then
>
> gxObjCont.DeleteChild gxObjChild
>
> 'gxObjCont.AreChildrenViewable
>
> 'Set gxObjChild = Nothing
>
> Set gxCat = gxDB
>
> gxCat.ObjectDeleted gxObjChild
>
> Exit Sub
>
> Else
>
> Set gxObjChild = EnmGxObj.Next
>
> End If
>
> Loop
>
>
>
> End Sub
>
>
>
> Can any one help me to know how I can delete the
> feature class correctly?
>
>
>
> Regards
>
>
>
> Ahmed Samir
>
> GIS Developer
>
> Integral Consult
>
> Ring Road,Maadi
>
> Cairo - Egypt
>
> Tel.: +20 2 5204500
>
> Fax: +20 2 5204505
>
> Email: [email protected]
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been
> removed]
>
>
>
>
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
RE: [GIS-Cafe] ArcCatalog
Dear Sir
I want to remove the Feature Class from the Geodatabase Permanently
I hope that any one can help me
Ahmed Samir
GIS Developer
Integral Consult
Ring Road,Maadi
Cairo - Egypt
Tel.: +20 2 5204500
Fax: +20 2 5204505
Email: [email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Farhad Kazemi
Sent: Tuesday, November 15, 2005 8:07 PM
To: [email protected]
Subject: Re: [GIS-Cafe] ArcCatalog
Hi Ahmed,
I have made a small modification in your code and
looks like it works. I am using ArcGIS 9.1 and I have
to specify the main esri library before the classes'
names(Forexample esriCatalog.IGxObject), but should
not make a differnce if you do not get compiler error.
Note that you do not see the deleted object class when
you refresh the ArcCatalog but if you close the
ArcCatalog and reopen it again you will see the
deleted object class because you only remove it from
you application not from your geodatabase. let me know
if you want to remove the object class from your
geodatabase permenantly.
Hope this helps,
Farhad
Public Sub DeleteFeatureClass(FeatureClassName As
String)
Dim gxObj As esriCatalog.IGxObject
Dim gxObjChild As esriCatalog.IGxObject
Dim gxApp As esriCatalogUI.IGxApplication
Dim EnmLyrs As IEnumLayer
Dim LyrFact As ILayerFactory
Dim gxDB As esriCatalog.IGxDatabase
Dim gxObjCont As esriCatalog.IGxObjectContainer
Dim EnmGxObj As esriCatalog.IEnumGxObject
Dim gxCat As esriCatalog.GxCatalog
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
msgbox gxObj.BaseName
'followings are the changes:
'******************************************************
'''''Set gxDB = gxObj
Set gxObjCont = gxObj
Set EnmGxObj = gxObjCont.Children
EnmGxObj.Reset
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = FeatureClassName Then
gxObjCont.DeleteChild gxObjChild
''''gxObjCont.AreChildrenViewable
''''Set gxObjChild = Nothing
''''Set gxCat = gxDB
''''gxCat.ObjectDeleted gxObjChild
Exit Sub
'******************************************************
Else
Set gxObjChild = EnmGxObj.Next
End If
Loop
End Sub
'
'
'Calling the procidure(you can do it other ways base
on your app 'requirements
Private Sub UIButtonControl1_Click()
DeleteFeatureClass "point"
End Sub
--- Ahmed Samir wrote:
>
>
> Dear All
>
>
>
> I need to delete an existing feature class from the
> ArcCatalog. The script
> run successfully, however when I refresh the
> Contents view in the ArcCatalog
> the feature class.
>
> Below the script I wrote.
>
>
>
>
>
> Public Sub DeleteFeatureClass(FeatureClassName As
> String)
>
>
>
> Dim gxObj As IGxObject
>
> Dim gxObjChild As IGxObject
>
> Dim gxApp As IGxApplication
>
> Dim EnmLyrs As IEnumLayer
>
> Dim LyrFact As ILayerFactory
>
> Dim gxDB As IGxDatabase
>
> Dim gxObjCont As IGxObjectContainer
>
> Dim EnmGxObj As IEnumGxObject
>
>
>
> Set gxApp = Application
>
> Set gxObj = gxApp.SelectedObject
>
> Debug.Print gxObj.BaseName
>
> Set gxDB = gxObj
>
> Set gxObjCont = gxDB
>
> Set EnmGxObj = gxObjCont.Children
>
> Set gxObjChild = EnmGxObj.Next
>
> Do Until gxObjChild Is Nothing
>
> If gxObjChild.BaseName = "AAA" Then
>
> gxObjCont.DeleteChild gxObjChild
>
> 'gxObjCont.AreChildrenViewable
>
> 'Set gxObjChild = Nothing
>
> Set gxCat = gxDB
>
> gxCat.ObjectDeleted gxObjChild
>
> Exit Sub
>
> Else
>
> Set gxObjChild = EnmGxObj.Next
>
> End If
>
> Loop
>
>
>
> End Sub
>
>
>
> Can any one help me to know how I can delete the
> feature class correctly?
>
>
>
> Regards
>
>
>
> Ahmed Samir
>
> GIS Developer
>
> Integral Consult
>
> Ring Road,Maadi
>
> Cairo - Egypt
>
> Tel.: +20 2 5204500
>
> Fax: +20 2 5204505
>
> Email: [email protected]
>
>
>
>
>
>
>
>
>
> [Non-text portions of this message have been
> removed]
>
>
>
>
__________________________________
Yahoo! FareChase: Search multiple travel sites in one click.
http://farechase.yahoo.com
Mideastern Cafe for GISers. Relax, discuss, and benefit!
http://groups.yahoo.com/group/gis-cafe
Yahoo! Groups Links
RE: [GIS-Cafe] ArcCatalog
Dear Ahmed,
You should use the proprties and mehtodes of
IGxApplication interface to delete any items in
ArcCatalog.
Followings are the complete codes you can use to
delete any geodatabase feature permenently. Plaese
modify the name for FeatureclassName and copy and past
it to a macro on your ArcCatalog, then select a folder
or a geodatabase connection and run the codes. Remeber
ArcCatalog does not allow deleting any feature classes
inside a coverage if is being used by other
applications since this action will break the topology
of the coverage, but you can delete the whole coverage
or remove the feature class from connection. Please
send me the exact error message if you get any errors.
you me add a few codes to your macro to select the top
node in the ArcCatalog and search the intire
connections for a specified feature class name.
Hope this helps,
Sallam alaikom,
Farhad
Option Explicit
Dim gxApp As esriCatalogUI.IGxApplication
'Calling procidure
Private Sub UIButtonControl1_Click()
Dim gxObj As esriCatalog.IGxObject
Set gxApp = Application
Set gxObj = gxApp.SelectedObject
MsgBox gxObj.BaseName 'Remove later
DeleteFeatureClass gxObj, "FarhadTest"
End Sub
Public Sub DeleteFeatureClass(gxObj As
esriCatalog.IGxObject, FeatureClassName As String)
Dim gxObjChild As esriCatalog.IGxObject
Dim gxObjCont As esriCatalog.IGxObjectContainer
Dim EnmGxObj As esriCatalog.IEnumGxObject
'MsgBox "gxObjCategory = " & gxObj.Category
Set gxObjCont = gxObj
Set EnmGxObj = gxObjCont.Children
EnmGxObj.Reset
Set gxObjChild = EnmGxObj.Next
Do Until gxObjChild Is Nothing
If gxObjChild.BaseName = FeatureClassName Then
gxApp.Selection.Select gxObjChild, False,
Nothing
MsgBox gxApp.SelectedObject.BaseName
gxApp.DeleteSelection
Exit Sub
End If
'Recursion through the children
'MsgBox "gxChildObj Category = " & gxObjChild.Category
If gxObjChild.Category <> "Shapefile" And _
gxObjChild.Category <> "dBASE Table" And _
gxObjChild.Category <> "" Then
Set gxObjCont = gxObjChild
If gxObjCont.HasChildren Then
DeleteFeatureClass gxObjChild, FeatureClassName
End If
End If
Set gxObjChild = EnmGxObj.Next
Loop
'set all objects to nothing here:
End Sub
--- Ahmed Samir wrote:
> Dear Sir wrote:
>
> I want to remove the Feature Class from the
> Geodatabase Permanently
>
>
> I hope that any one can help me
>
>
> Ahmed Samir
> GIS Developer
> Integral Consult
> Ring Road,Maadi
> Cairo - Egypt
> Tel.: +20 2 5204500
> Fax: +20 2 5204505
> Email: [email protected]
>
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf
> Of Farhad Kazemi
> Sent: Tuesday, November 15, 2005 8:07 PM
> To: [email protected]
> Subject: Re: [GIS-Cafe] ArcCatalog
>
> Hi Ahmed,
>
> I have made a small modification in your code and
> looks like it works. I am using ArcGIS 9.1 and I
> have
> to specify the main esri library before the classes'
> names(Forexample esriCatalog.IGxObject), but should
> not make a differnce if you do not get compiler
> error.
> Note that you do not see the deleted object class
> when
> you refresh the ArcCatalog but if you close the
> ArcCatalog and reopen it again you will see the
> deleted object class because you only remove it from
> you application not from your geodatabase. let me
> know
> if you want to remove the object class from your
> geodatabase permenantly.
>
>
> Hope this helps,
>
> Farhad
>
> Public Sub DeleteFeatureClass(FeatureClassName As
> String)
>
> Dim gxObj As esriCatalog.IGxObject
> Dim gxObjChild As esriCatalog.IGxObject
> Dim gxApp As esriCatalogUI.IGxApplication
> Dim EnmLyrs As IEnumLayer
> Dim LyrFact As ILayerFactory
> Dim gxDB As esriCatalog.IGxDatabase
> Dim gxObjCont As esriCatalog.IGxObjectContainer
> Dim EnmGxObj As esriCatalog.IEnumGxObject
> Dim gxCat As esriCatalog.GxCatalog
> Set gxApp = Application
> Set gxObj = gxApp.SelectedObject
>
> msgbox gxObj.BaseName
> 'followings are the changes:
>
'******************************************************
> '''''Set gxDB = gxObj
> Set gxObjCont = gxObj
> Set EnmGxObj = gxObjCont.Children
> EnmGxObj.Reset
> Set gxObjChild = EnmGxObj.Next
> Do Until gxObjChild Is Nothing
> If gxObjChild.BaseName = FeatureClassName
> Then
> gxObjCont.DeleteChild gxObjChild
> ''''gxObjCont.AreChildrenViewable
> ''''Set gxObjChild = Nothing
> ''''Set gxCat = gxDB
> ''''gxCat.ObjectDeleted gxObjChild
>
> Exit Sub
>
'******************************************************
> Else
>
> Set gxObjChild = EnmGxObj.Next
>
> End If
>
> Loop
>
>
>
> End Sub
> '
> '
> 'Calling the procidure(you can do it other ways base
> on your app 'requirements
> Private Sub UIButtonControl1_Click()
> DeleteFeatureClass "point"
> End Sub
>
>
>
> --- Ahmed Samir
>
> >
> >
> > Dear All
> >
> >
> >
> > I need to delete an existing feature class from
> the
> > ArcCatalog. The script
> > run successfully, however when I refresh the
> > Contents view in the ArcCatalog
> > the feature class.
> >
> > Below the script I wrote.
> >
> >
> >
> >
> >
> > Public Sub DeleteFeatureClass(FeatureClassName As
> > String)
> >
> >
> >
> > Dim gxObj As IGxObject
> >
> > Dim gxObjChild As IGxObject
> >
> > Dim gxApp As IGxApplication
> >
> > Dim EnmLyrs As IEnumLayer
> >
> > Dim LyrFact As ILayerFactory
> >
> > Dim gxDB As IGxDatabase
> >
> > Dim gxObjCont As IGxObjectContainer
> >
> > Dim EnmGxObj As IEnumGxObject
> >
> >
> >
> > Set gxApp = Application
> >
> > Set gxObj = gxApp.SelectedObject
> >
> > Debug.Print gxObj.BaseName
> >
> > Set gxDB = gxObj
> >
> > Set gxObjCont = gxDB
> >
> > Set EnmGxObj = gxObjCont.Children
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > Do Until gxObjChild Is Nothing
> >
> > If gxObjChild.BaseName = "AAA" Then
> >
> > gxObjCont.DeleteChild gxObjChild
> >
> > 'gxObjCont.AreChildrenViewable
> >
> > 'Set gxObjChild = Nothing
> >
> > Set gxCat = gxDB
> >
> > gxCat.ObjectDeleted gxObjChild
> >
> > Exit Sub
> >
> > Else
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > End If
> >
> > Loop
> >
> >
> >
> > End Sub
> >
> >
> >
> > Can any one help me to know how I can delete the
> > feature class correctly?
> >
> >
> >
> > Regards
> >
>
=== message truncated ===
__________________________________
Start your day with Yahoo! - Make it your home page!
http://www.yahoo.com/r/hs
Re: ArcCatalog
Dear Ahmed,
You should work on "IWorkspace", then get hold to the datasets
in the desird workspace using "IEnumDataset", queryinterface the
dataset with the featureclass, & finally delete.
The following code deletes empty tables in a Geodatabase:
--------------------------------------------------------------
Private Sub UIBtnCntrDel_Click()
Dim pWSpaceFactory As IWorkspaceFactory
Dim pworkspace As IWorkspace
Dim pEnumDatasets As IEnumDataset
Dim pDataset As IDataset
Dim pFeatclass As IFeatureClass
Dim ptable As ITable
Dim pQueryfilter As IQueryFilter
Set pWSpaceFactory = New AccessWorkspaceFactory
Set pworkspace = pWSpaceFactory.OpenFromFile("E:\DB_Handling\" &
f2.Name & "\" & f1.Name, 0)
Set pEnumDatasets = pworkspace.Datasets(esriDTTable)
Set pDataset = pEnumDatasets.Next
Set pQueryfilter = New QueryFilter
Do Until pDataset Is Nothing
'MsgBox (pDataset.Name)
Set ptable = pDataset
If ptable.RowCount(Nothing) = 0 Then
Set pDataset = ptable
pDataset.Delete
End If
Set pDataset = pEnumDatasets.Next
Loop
End Sub
--- In [email protected], Farhad Kazemi wrote: wrote:
wrote:
>
> Dear Ahmed,
>
> You should use the proprties and mehtodes of
> IGxApplication interface to delete any items in
> ArcCatalog.
> Followings are the complete codes you can use to
> delete any geodatabase feature permenently. Plaese
> modify the name for FeatureclassName and copy and past
> it to a macro on your ArcCatalog, then select a folder
> or a geodatabase connection and run the codes. Remeber
> ArcCatalog does not allow deleting any feature classes
> inside a coverage if is being used by other
> applications since this action will break the topology
> of the coverage, but you can delete the whole coverage
> or remove the feature class from connection. Please
> send me the exact error message if you get any errors.
> you me add a few codes to your macro to select the top
> node in the ArcCatalog and search the intire
> connections for a specified feature class name.
>
> Hope this helps,
>
> Sallam alaikom,
>
> Farhad
>
>
> Option Explicit
> Dim gxApp As esriCatalogUI.IGxApplication
>
> 'Calling procidure
> Private Sub UIButtonControl1_Click()
>
> Dim gxObj As esriCatalog.IGxObject
> Set gxApp = Application
> Set gxObj = gxApp.SelectedObject
>
> MsgBox gxObj.BaseName 'Remove later
>
> DeleteFeatureClass gxObj, "FarhadTest"
> End Sub
>
>
> Public Sub DeleteFeatureClass(gxObj As
> esriCatalog.IGxObject, FeatureClassName As String)
>
> Dim gxObjChild As esriCatalog.IGxObject
> Dim gxObjCont As esriCatalog.IGxObjectContainer
> Dim EnmGxObj As esriCatalog.IEnumGxObject
>
> 'MsgBox "gxObjCategory = " & gxObj.Category
>
> Set gxObjCont = gxObj
>
> Set EnmGxObj = gxObjCont.Children
> EnmGxObj.Reset
> Set gxObjChild = EnmGxObj.Next
> Do Until gxObjChild Is Nothing
> If gxObjChild.BaseName = FeatureClassName Then
> gxApp.Selection.Select gxObjChild, False,
> Nothing
>
> MsgBox gxApp.SelectedObject.BaseName
>
> gxApp.DeleteSelection
> Exit Sub
> End If
> 'Recursion through the children
> 'MsgBox "gxChildObj Category = " & gxObjChild.Category
> If gxObjChild.Category <> "Shapefile" And _
> gxObjChild.Category <> "dBASE Table" And _
> gxObjChild.Category <> "" Then
>
> Set gxObjCont = gxObjChild
> If gxObjCont.HasChildren Then
> DeleteFeatureClass gxObjChild, FeatureClassName
> End If
> End If
> Set gxObjChild = EnmGxObj.Next
>
> Loop
> 'set all objects to nothing here:
>
> End Sub
>
>
>
>
>
>
> --- Ahmed Samir
>
> > Dear Sir
> >
> > I want to remove the Feature Class from the
> > Geodatabase Permanently
> >
> >
> > I hope that any one can help me
> >
> >
> > Ahmed Samir
> > GIS Developer
> > Integral Consult
> > Ring Road,Maadi
> > Cairo - Egypt
> > Tel.: +20 2 5204500
> > Fax: +20 2 5204505
> > Email: asamir@i...
> >
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf
> > Of Farhad Kazemi
> > Sent: Tuesday, November 15, 2005 8:07 PM
> > To: [email protected]
> > Subject: Re: [GIS-Cafe] ArcCatalog
> >
> > Hi Ahmed,
> >
> > I have made a small modification in your code and
> > looks like it works. I am using ArcGIS 9.1 and I
> > have
> > to specify the main esri library before the classes'
> > names(Forexample esriCatalog.IGxObject), but should
> > not make a differnce if you do not get compiler
> > error.
> > Note that you do not see the deleted object class
> > when
> > you refresh the ArcCatalog but if you close the
> > ArcCatalog and reopen it again you will see the
> > deleted object class because you only remove it from
> > you application not from your geodatabase. let me
> > know
> > if you want to remove the object class from your
> > geodatabase permenantly.
> >
> >
> > Hope this helps,
> >
> > Farhad
> >
> > Public Sub DeleteFeatureClass(FeatureClassName As
> > String)
> >
> > Dim gxObj As esriCatalog.IGxObject
> > Dim gxObjChild As esriCatalog.IGxObject
> > Dim gxApp As esriCatalogUI.IGxApplication
> > Dim EnmLyrs As IEnumLayer
> > Dim LyrFact As ILayerFactory
> > Dim gxDB As esriCatalog.IGxDatabase
> > Dim gxObjCont As esriCatalog.IGxObjectContainer
> > Dim EnmGxObj As esriCatalog.IEnumGxObject
> > Dim gxCat As esriCatalog.GxCatalog
> > Set gxApp = Application
> > Set gxObj = gxApp.SelectedObject
> >
> > msgbox gxObj.BaseName
> > 'followings are the changes:
> >
> '******************************************************
> > '''''Set gxDB = gxObj
> > Set gxObjCont = gxObj
> > Set EnmGxObj = gxObjCont.Children
> > EnmGxObj.Reset
> > Set gxObjChild = EnmGxObj.Next
> > Do Until gxObjChild Is Nothing
> > If gxObjChild.BaseName = FeatureClassName
> > Then
> > gxObjCont.DeleteChild gxObjChild
> > ''''gxObjCont.AreChildrenViewable
> > ''''Set gxObjChild = Nothing
> > ''''Set gxCat = gxDB
> > ''''gxCat.ObjectDeleted gxObjChild
> >
> > Exit Sub
> >
> '******************************************************
> > Else
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > End If
> >
> > Loop
> >
> >
> >
> > End Sub
> > '
> > '
> > 'Calling the procidure(you can do it other ways base
> > on your app 'requirements
> > Private Sub UIButtonControl1_Click()
> > DeleteFeatureClass "point"
> > End Sub
> >
> >
> >
> > --- Ahmed Samir
> >
> > >
> > >
> > > Dear All
> > >
> > >
> > >
> > > I need to delete an existing feature class from
> > the
> > > ArcCatalog. The script
> > > run successfully, however when I refresh the
> > > Contents view in the ArcCatalog
> > > the feature class.
> > >
> > > Below the script I wrote.
> > >
> > >
> > >
> > >
> > >
> > > Public Sub DeleteFeatureClass(FeatureClassName As
> > > String)
> > >
> > >
> > >
> > > Dim gxObj As IGxObject
> > >
> > > Dim gxObjChild As IGxObject
> > >
> > > Dim gxApp As IGxApplication
> > >
> > > Dim EnmLyrs As IEnumLayer
> > >
> > > Dim LyrFact As ILayerFactory
> > >
> > > Dim gxDB As IGxDatabase
> > >
> > > Dim gxObjCont As IGxObjectContainer
> > >
> > > Dim EnmGxObj As IEnumGxObject
> > >
> > >
> > >
> > > Set gxApp = Application
> > >
> > > Set gxObj = gxApp.SelectedObject
> > >
> > > Debug.Print gxObj.BaseName
> > >
> > > Set gxDB = gxObj
> > >
> > > Set gxObjCont = gxDB
> > >
> > > Set EnmGxObj = gxObjCont.Children
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > Do Until gxObjChild Is Nothing
> > >
> > > If gxObjChild.BaseName = "AAA" Then
> > >
> > > gxObjCont.DeleteChild gxObjChild
> > >
> > > 'gxObjCont.AreChildrenViewable
> > >
> > > 'Set gxObjChild = Nothing
> > >
> > > Set gxCat = gxDB
> > >
> > > gxCat.ObjectDeleted gxObjChild
> > >
> > > Exit Sub
> > >
> > > Else
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > End If
> > >
> > > Loop
> > >
> > >
> > >
> > > End Sub
> > >
> > >
> > >
> > > Can any one help me to know how I can delete the
> > > feature class correctly?
> > >
> > >
> > >
> > > Regards
> > >
> >
> === message truncated ===
>
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
>
RE: [GIS-Cafe] Re: ArcCatalog
Dear Marwa
Thank you for your efforts
I did it week ago. Your script looks like what I did.
Keep in touch
Ahmed Samir
GIS Developer
Integral Consult
Ring Road,Maadi
Cairo - Egypt
Tel.: +20 2 5204500
Fax: +20 2 5204505
Email: [email protected]
-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf
Of Marwa Abou El Hassan
Sent: Thursday, November 24, 2005 2:10 PM
To: [email protected]
Subject: [GIS-Cafe] Re: ArcCatalog
Dear Ahmed,
You should work on "IWorkspace", then get hold to the datasets
in the desird workspace using "IEnumDataset", queryinterface the
dataset with the featureclass, & finally delete.
The following code deletes empty tables in a Geodatabase:
--------------------------------------------------------------
Private Sub UIBtnCntrDel_Click()
Dim pWSpaceFactory As IWorkspaceFactory
Dim pworkspace As IWorkspace
Dim pEnumDatasets As IEnumDataset
Dim pDataset As IDataset
Dim pFeatclass As IFeatureClass
Dim ptable As ITable
Dim pQueryfilter As IQueryFilter
Set pWSpaceFactory = New AccessWorkspaceFactory
Set pworkspace = pWSpaceFactory.OpenFromFile("E:\DB_Handling\" &
f2.Name & "\" & f1.Name, 0)
Set pEnumDatasets = pworkspace.Datasets(esriDTTable)
Set pDataset = pEnumDatasets.Next
Set pQueryfilter = New QueryFilter
Do Until pDataset Is Nothing
'MsgBox (pDataset.Name)
Set ptable = pDataset
If ptable.RowCount(Nothing) = 0 Then
Set pDataset = ptable
pDataset.Delete
End If
Set pDataset = pEnumDatasets.Next
Loop
End Sub
--- In [email protected], Farhad Kazemi
wrote:
>
> Dear Ahmed,
>
> You should use the proprties and mehtodes of
> IGxApplication interface to delete any items in
> ArcCatalog.
> Followings are the complete codes you can use to
> delete any geodatabase feature permenently. Plaese
> modify the name for FeatureclassName and copy and past
> it to a macro on your ArcCatalog, then select a folder
> or a geodatabase connection and run the codes. Remeber
> ArcCatalog does not allow deleting any feature classes
> inside a coverage if is being used by other
> applications since this action will break the topology
> of the coverage, but you can delete the whole coverage
> or remove the feature class from connection. Please
> send me the exact error message if you get any errors.
> you me add a few codes to your macro to select the top
> node in the ArcCatalog and search the intire
> connections for a specified feature class name.
>
> Hope this helps,
>
> Sallam alaikom,
>
> Farhad
>
>
> Option Explicit
> Dim gxApp As esriCatalogUI.IGxApplication
>
> 'Calling procidure
> Private Sub UIButtonControl1_Click()
>
> Dim gxObj As esriCatalog.IGxObject
> Set gxApp = Application
> Set gxObj = gxApp.SelectedObject
>
> MsgBox gxObj.BaseName 'Remove later
>
> DeleteFeatureClass gxObj, "FarhadTest"
> End Sub
>
>
> Public Sub DeleteFeatureClass(gxObj As
> esriCatalog.IGxObject, FeatureClassName As String)
>
> Dim gxObjChild As esriCatalog.IGxObject
> Dim gxObjCont As esriCatalog.IGxObjectContainer
> Dim EnmGxObj As esriCatalog.IEnumGxObject
>
> 'MsgBox "gxObjCategory = " & gxObj.Category
>
> Set gxObjCont = gxObj
>
> Set EnmGxObj = gxObjCont.Children
> EnmGxObj.Reset
> Set gxObjChild = EnmGxObj.Next
> Do Until gxObjChild Is Nothing
> If gxObjChild.BaseName = FeatureClassName Then
> gxApp.Selection.Select gxObjChild, False,
> Nothing
>
> MsgBox gxApp.SelectedObject.BaseName
>
> gxApp.DeleteSelection
> Exit Sub
> End If
> 'Recursion through the children
> 'MsgBox "gxChildObj Category = " & gxObjChild.Category
> If gxObjChild.Category <> "Shapefile" And _
> gxObjChild.Category <> "dBASE Table" And _
> gxObjChild.Category <> "" Then
>
> Set gxObjCont = gxObjChild
> If gxObjCont.HasChildren Then
> DeleteFeatureClass gxObjChild, FeatureClassName
> End If
> End If
> Set gxObjChild = EnmGxObj.Next
>
> Loop
> 'set all objects to nothing here:
>
> End Sub
>
>
>
>
>
>
> --- Ahmed Samir wrote:
>
> > Dear Sir
> >
> > I want to remove the Feature Class from the
> > Geodatabase Permanently
> >
> >
> > I hope that any one can help me
> >
> >
> > Ahmed Samir
> > GIS Developer
> > Integral Consult
> > Ring Road,Maadi
> > Cairo - Egypt
> > Tel.: +20 2 5204500
> > Fax: +20 2 5204505
> > Email: asamir@i...
> >
> >
> > -----Original Message-----
> > From: [email protected]
> > [mailto:[email protected]] On Behalf
> > Of Farhad Kazemi
> > Sent: Tuesday, November 15, 2005 8:07 PM
> > To: [email protected]
> > Subject: Re: [GIS-Cafe] ArcCatalog
> >
> > Hi Ahmed,
> >
> > I have made a small modification in your code and
> > looks like it works. I am using ArcGIS 9.1 and I
> > have
> > to specify the main esri library before the classes'
> > names(Forexample esriCatalog.IGxObject), but should
> > not make a differnce if you do not get compiler
> > error.
> > Note that you do not see the deleted object class
> > when
> > you refresh the ArcCatalog but if you close the
> > ArcCatalog and reopen it again you will see the
> > deleted object class because you only remove it from
> > you application not from your geodatabase. let me
> > know
> > if you want to remove the object class from your
> > geodatabase permenantly.
> >
> >
> > Hope this helps,
> >
> > Farhad
> >
> > Public Sub DeleteFeatureClass(FeatureClassName As
> > String)
> >
> > Dim gxObj As esriCatalog.IGxObject
> > Dim gxObjChild As esriCatalog.IGxObject
> > Dim gxApp As esriCatalogUI.IGxApplication
> > Dim EnmLyrs As IEnumLayer
> > Dim LyrFact As ILayerFactory
> > Dim gxDB As esriCatalog.IGxDatabase
> > Dim gxObjCont As esriCatalog.IGxObjectContainer
> > Dim EnmGxObj As esriCatalog.IEnumGxObject
> > Dim gxCat As esriCatalog.GxCatalog
> > Set gxApp = Application
> > Set gxObj = gxApp.SelectedObject
> >
> > msgbox gxObj.BaseName
> > 'followings are the changes:
> >
> '******************************************************
> > '''''Set gxDB = gxObj
> > Set gxObjCont = gxObj
> > Set EnmGxObj = gxObjCont.Children
> > EnmGxObj.Reset
> > Set gxObjChild = EnmGxObj.Next
> > Do Until gxObjChild Is Nothing
> > If gxObjChild.BaseName = FeatureClassName
> > Then
> > gxObjCont.DeleteChild gxObjChild
> > ''''gxObjCont.AreChildrenViewable
> > ''''Set gxObjChild = Nothing
> > ''''Set gxCat = gxDB
> > ''''gxCat.ObjectDeleted gxObjChild
> >
> > Exit Sub
> >
> '******************************************************
> > Else
> >
> > Set gxObjChild = EnmGxObj.Next
> >
> > End If
> >
> > Loop
> >
> >
> >
> > End Sub
> > '
> > '
> > 'Calling the procidure(you can do it other ways base
> > on your app 'requirements
> > Private Sub UIButtonControl1_Click()
> > DeleteFeatureClass "point"
> > End Sub
> >
> >
> >
> > --- Ahmed Samir wrote:
> >
> > >
> > >
> > > Dear All
> > >
> > >
> > >
> > > I need to delete an existing feature class from
> > the
> > > ArcCatalog. The script
> > > run successfully, however when I refresh the
> > > Contents view in the ArcCatalog
> > > the feature class.
> > >
> > > Below the script I wrote.
> > >
> > >
> > >
> > >
> > >
> > > Public Sub DeleteFeatureClass(FeatureClassName As
> > > String)
> > >
> > >
> > >
> > > Dim gxObj As IGxObject
> > >
> > > Dim gxObjChild As IGxObject
> > >
> > > Dim gxApp As IGxApplication
> > >
> > > Dim EnmLyrs As IEnumLayer
> > >
> > > Dim LyrFact As ILayerFactory
> > >
> > > Dim gxDB As IGxDatabase
> > >
> > > Dim gxObjCont As IGxObjectContainer
> > >
> > > Dim EnmGxObj As IEnumGxObject
> > >
> > >
> > >
> > > Set gxApp = Application
> > >
> > > Set gxObj = gxApp.SelectedObject
> > >
> > > Debug.Print gxObj.BaseName
> > >
> > > Set gxDB = gxObj
> > >
> > > Set gxObjCont = gxDB
> > >
> > > Set EnmGxObj = gxObjCont.Children
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > Do Until gxObjChild Is Nothing
> > >
> > > If gxObjChild.BaseName = "AAA" Then
> > >
> > > gxObjCont.DeleteChild gxObjChild
> > >
> > > 'gxObjCont.AreChildrenViewable
> > >
> > > 'Set gxObjChild = Nothing
> > >
> > > Set gxCat = gxDB
> > >
> > > gxCat.ObjectDeleted gxObjChild
> > >
> > > Exit Sub
> > >
> > > Else
> > >
> > > Set gxObjChild = EnmGxObj.Next
> > >
> > > End If
> > >
> > > Loop
> > >
> > >
> > >
> > > End Sub
> > >
> > >
> > >
> > > Can any one help me to know how I can delete the
> > > feature class correctly?
> > >
> > >
> > >
> > > Regards
> > >
> >
> === message truncated ===
>
>
>
>
> __________________________________
> Start your day with Yahoo! - Make it your home page!
> http://www.yahoo.com/r/hs
>
Mideastern Cafe for GISers. Relax, discuss, and benefit!
http://groups.yahoo.com/group/gis-cafe
Yahoo! Groups Links
http://groups.yahoo.com/group/gis-cafe/
[email protected]
http://docs.yahoo.com/info/terms/
[Non-text portions of this message have been removed]