13 Replies Latest reply on Aug 14, 2014 12:50 PM by acmadison

    Does the ArcFM Object Converter work on PGDB's?

    Keith Joiner

      I have a PGDB which is an extract from SDE (ArcFM), and need to distribute the PGDB to entities that do not have ArcFM. Anyone who does not have ArcFM cannot read the resulting PGDB due to the existance of the ArcFM objects. I do not want to have to tell other entities to use the ArcFM Reader solution in order to read the PGDB. Should I somehow convert the objects to Esri objects prior to the extract from SDE?

       

      Keith Joiner

      GIS BA, GISP

      JEA

      (904) 665-8690

      joinek@jea.com

        • Re: Does the ArcFM Object Converter work on PGDB's?
          brownkj

          Indeed it can, you just need to export some of the MM* tables so that the object converter recognizes the gdb as an ArcFM-ified database.  I worked this out a while back so I don't remember exactly which ones you need but try including MM_HIDDEN_PACKAGES, MM_SYSTEM_PERSIST_INFO and MM_SYSTEM_PACKAGES to start with.

           

          You can also write your own object converter that doesn't require the MM tables to be present.  Here's the relevant parts of mine:

          <CODE>

               //Initialize MM license before here

               IMMObjectClassConversionTool converter = Activator.CreateInstance(Type.GetTypeFromProgID("MMGXTools.MMObjectClassConversionTool")) as IMMObjectClassConversionTool;

               var wksp = GRUEDArcGISCore.GetWorkspace(args[0]);   // ("c:\\temp\\ED_Extract.mdb");

               if (wksp != null)
               {
                    var datasets = wksp.get_Datasets(esriDatasetType.esriDTAny);

                    ConvertDataset(converter, datasets, mmObjectClassConversionOption.mmConvertToESRI, verbose);

               }

           

          private static void ConvertDataset(IMMObjectClassConversionTool converter, IEnumDataset datasets, mmObjectClassConversionOption convertTo, bool verbose)
               {

                    IDataset ds = datasets.Next();

                    while (ds != null)
                    {

                         if (converter.ConvertClass(ds as IClass, convertTo, false))

                         {
                              if (verbose)
                                   Console.WriteLine("Converted " + ds.Name + " to " + convertTo.ToString());

                         }
                         else
                              Console.WriteLine("Failed to convert " + ds.Name + " to " + convertTo.ToString());

                         try
                         {
                              IEnumDataset subDS = ds.Subsets;    //this will throw a COM error if ds is a default network junction featureclass, relationship, or objectclass
                              if (subDS != null)
                                   ConvertDataset(converter, subDS, convertTo, verbose);
                         }
                         catch
                         {
                              Trace.WriteLine("Error on " + ds.Name);
                         }

                         ds = datasets.Next();
                    }
               }

          </CODE>

          • Re: Does the ArcFM Object Converter work on PGDB's?
            Lane Howerton

            You can install the ArcFM Object Reader on their machines and that will allow them to read the data in standard ArcMap, without of the course the ArcFM functionality.

            • Re: Does the ArcFM Object Converter work on PGDB's?

              As Kevin Brown mentioned above, you'll need (a subset of) the MM_* tables in the geodatabase to run the ArcFM Solution Object Converter.

               

              The fastest method to do this is probably to run the Create/Upgrade ArcFM Solution System Tables tool, followed by the Upgrade ArcFM Solution Database tool and then you should be able to run the ArcFM Solution Object Converter to convert everything in that database to Esri objects.  From there you can delete the MM_* tables if necessary.

               

              Alternately, use the attached guide to strip all custom COM from a gdb (ie, convert ArcFM objects to Esri objects).

                • Re: Does the ArcFM Object Converter work on PGDB's?
                  Keith Joiner

                  OK great. Thanks a bunch.

                  • Re: Does the ArcFM Object Converter work on PGDB's?

                    Hi Matt  - thanks for the posting and code - it was illuminating!

                     

                    I came across this thread as I too am trying to remove custom com objects from a PGDB.

                    I have the tool "working" but when I run it against a PGDB I get the error "The Microsoft Jet database engine cannot find the input table or query 'gdb_objectclasses."

                    So I looked in via MS ACCESS and sure enough the table is missing. Seems like someone forgot to give me something!

                    Is there anything I can tell the Fiber Manager users who prepared the PDGB for me to include or a particular command or technique to use?

                     

                    TIA

                     

                    Aaron Cohen

                    City of Madison, Wisconsin

                      • Re: Does the ArcFM Object Converter work on PGDB's?
                        brownkj

                        The gdb_objectclasses table is no longer part of a gdb at v10.  Seems like the code you're running might be pointing to a 9.x library for the IMMObjectClassConversionTool.

                          • Re: Does the ArcFM Object Converter work on PGDB's?

                            Makes sense – I’ve got 9.x code running against a 10.x PGDB. Rats!

                            Back to the drawing board.

                             

                            Aaron Cohen

                            • Re: Does the ArcFM Object Converter work on PGDB's?

                              Kevin

                               

                              Are you aware of any solutions similar to Matt's that function on newer geodatabases?

                              The newer ESRI deployment would build an Add-in to do what I just tried to do via VBA.

                               

                              Thanks for the fast response.

                                • Re: Does the ArcFM Object Converter work on PGDB's?
                                  brownkj

                                  Just guessing, but it looks like you may be able to use the same technique by changing "gdb_objectclasses" to "gdb_items" and "clsid" to "UUID".  The actual GUID values have changed, though, so you'll have to figure out what the appropriate "from" and "to" values are.  Be careful since there are more things in the gdb_items table than there used to be in gdb_objectclasses.  And since this is a "hack it from the back" method, let the buyer beware (fairly safe, though, since you're working on copied out data).

                                    • Re: Does the ArcFM Object Converter work on PGDB's?

                                      Kevin Brown wrote:

                                       

                                      The gdb_objectclasses table is no longer part of a gdb at v10.  Seems like the code you're running might be pointing to a 9.x library for the IMMObjectClassConversionTool.

                                      As Kevin is saying, the gdb_objectclasses is part of the old 9x gdb table structure and was removed between 9x and 10.0.x - though I haven't had cause to dig into what table/structure replaced it.

                                       

                                      Kevin Brown wrote:

                                       

                                      Just guessing, but it looks like you may be able to use the same technique by changing "gdb_objectclasses" to "gdb_items" and "clsid" to "UUID".  The actual GUID values have changed, though, so you'll have to figure out what the appropriate "from" and "to" values are.  Be careful since there are more things in the gdb_items table than there used to be in gdb_objectclasses.  And since this is a "hack it from the back" method, let the buyer beware (fairly safe, though, since you're working on copied out data).

                                      This method sounds like the way to go to me.  Since you're using an access database in this case, you should be able to use the object converter tool to pull those 'to' and 'from' GUID values by examining the appropriate table in Access.  One thing to note, is that you don't want to change the GUID values of the MM_* tables.  That will cause problems for ArcFM tools, even if the rest of the data is un-ArcFM'ified.

                            • Re: Does the ArcFM Object Converter work on PGDB's?

                              Hi Keith,

                               

                              I wanted to follow-up with you on this thread and see if any of the answers above provide what you were looking for.  If so, please find the one that does and and mark it as the "Correct Answer".  If not let us know and if possible, clarify-in-advance what additional details you might be looking for.

                               

                              Note that as it mentions here, only one answer can be marked the 'Correct Answer', but several answers can be marked as helpful, so feel free to mark other contribution as a 'Helpful Answer' if applicable.

                               

                              Thanks!