2 Replies Latest reply on Mar 30, 2016 10:09 AM by Kyle Baesler

    Can I execute the "arcfm solution object converter" from c# code?

    David Ronald Suárez Urresti

      Hi I'm trying to automate a task that need to convert arcfm object to esri object. Can I execute the "arcfm solution object converter" from c# code?

        • Re: Can I execute the "arcfm solution object converter" from c# code?
          Malcolm Post

          There is a VBA example in the 10.0.3 developer help at this link. I don't know why the latest version of the help doesn't include the  IMMObjectClassConversionTool, but it looks like the ProgId for the conversion tool is still in the registry with the 10.2.1b release. More than likely, the VBA code  could be rewritten in C# and it would work with current ArcFM versions.

          • Re: Can I execute the "arcfm solution object converter" from c# code?
            Kyle Baesler

            David,

             

            The following snippet should help point you in the right direction.

             

                   public void ConvertClasses(IFeatureDataset featureDataset)

                    {

                        var conversion =

                            (IMMObjectClassConversionTool)

                                Activator.CreateInstance(Type.GetTypeFromProgID("MMGXTools.MMObjectClassConversionTool"));

             

                        var container = (IFeatureClassContainer) featureDataset;

                        foreach (var featureClass in container.AsEnumerable())

                        {

                            conversion.ConvertClass(featureClass, mmObjectClassConversionOption.mmConvertToArcFM, false);

                        }

                    }