"Opening" non-existing FeatureClass via IGxDialog

449
2
07-20-2011 05:15 AM
SebastianKrings
Occasional Contributor
Hello,

I want to create an Open-Dialog where the user can choose a featureclass from a filegeodatabase.
For this I use IGxDialog in combination with the GxFilterFGDBFeatureClassesClass.
The thing is, that I must choose an existing featureclass. Dialog is forcing me to select an exisiting featureclass.

But like in many arcmap tools you can open a gbd and a dataset if you want and then you can type the name of the featureclass you want instead of selecting an existing. If the feature class you typed in does not exist, arcmap will create it in the fgdb. And this is want I want, too.

I think I were able to create a feature in a gbd. But how to get through the dialogs message to that the selected feature does not exist. Because the opendialog will stay. It would help if I just could read the selected path, whether or not the file exists.
And its very important to keep the filter (GxFilterFGDBFeatureClassesClass);


thats my code:
IGxObjectFilter filter = new GxFilterFGDBFeatureClassesClass();
            IEnumGxObject selektion = null;
            IGxDialog dialog = new GxDialog();
            dialog.ObjectFilter = filter;
            dialog.Title = "Output Feature wählen";
            dialog.ButtonCaption = "OK";

            if (dialog.DoModalOpen(0, out selektion))
            {
                IGxObject obj = selektion.Next();
                tbOutputFeature.Text = obj.FullName;
            }


Thanks for any ideas and help.
0 Kudos
2 Replies
NeilClemmons
Regular Contributor III
You're calling DoModalOpen, which is a dialog for opening.  You can't open what doesn't exist so that's why it gives you that message.  You should call DoModalSave.
0 Kudos
SebastianKrings
Occasional Contributor
of course... oh damn

Im so sorry for creating this thread...

but thank you very much 🙂
0 Kudos