ArcGIS 10.4. I am looking for a geoprocess to take an existing feature class and make it Z and M aware. The feature class is in a file geodb. I have been looking in the ESRI website but have not found anything that applies.

Edit: The solution was to copy the feature class with M and Z flags enabled, delete the original feature class, and rename the new feature class. Code looks like this:

        Using releaser As New ESRI.ArcGIS.ADF.ComReleaser
            'initialize the geoprocessor
            Dim GP As ESRI.ArcGIS.Geoprocessing.GeoProcessor = New ESRI.ArcGIS.Geoprocessing.GeoProcessor
            GP.AddOutputsToMap = False  'True if we want to add outputs to map, False if we dont. however we manually do this at the very end since the GP doesnt give us a layer reference.
            GP.OverwriteOutput = True   'True if output exists then will delete the old output before creating new output

            'set environment settings to enable M and Z awareness
            GP.SetEnvironmentValue("outputMFlag", "Enabled")
            GP.SetEnvironmentValue("outputZFlag", "Enabled")

            'create an IVariantArray to hold the parameter values
            Dim parameters As IVariantArray = New VarArray

            'populate the variant array with parameter values
            parameters.Add(outGdbFeats)     'feature class or feature layer that will be converted
            parameters.Add(outDst)          'location in which the output feature class will be created
            parameters.Add(outGdbFeatsMz)   'name of the output feature class
            parameters.Add("")              '(optional) SQL expression used to select a subset of features
            parameters.Add("")              '(optional) fields and field contents chosen from the input feature class
            parameters.Add("")              '(optional) configuration keywords

            'execute the model tool by name
            Dim res As ESRI.ArcGIS.Geoprocessing.IGeoProcessorResult = GP.Execute("FeatureClassToFeatureClass_conversion", parameters, Nothing)
        End Using
  • It isn't possible to change an existing feature class, but you can create a new one. – Vince Jan 4 at 18:25
  • As @Vince said, Create a new featureclass based on the original, same fields, same Coord system, then append the new FC. – klewis Jan 4 at 18:32

It is not possible to enable m and z values for an existing feature class. You'll need to recreate it with m and z values enabled.

Use the Feature Class to Feature Class conversion tool.

Go into the environment settings and enable m and z values as shown in the image below:

enter image description here

  • Didn't realize this was the case. Let me look at the tool. – sinDizzy Jan 4 at 20:00
  • This is standard ESRI methodology. They don't like to let you modify anything in place – jbalk Jan 4 at 20:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.