PROBLEM

Cannot start editing a theme with Z values

Last Published: April 25, 2020

Description

The Start Editing tool is greyed out after importing or adding a theme that has z values. This includes CAD files, coverages, and 3D shapefiles.

Cause

The theme in question is a ShapeZ, which cannot be edited without the 3D Analyst extension.

Solution or Workaround

To confirm you have a shapeZ, open the theme attribute table and look at the shape column. If it says PointZ, LineZ, PolylineZ, or PolygonZ, you need to use the following script to convert your 3D shapefile into a 2D shapefile that can be modified in ArcView.

  1. Open a new Script window.

    A. Activate the Project window.
    B. Click the Scripts icon.
    C. Click New.

  2. Copy the following script into the new window:

    Code:
    '-- Converts 3D shapefile to 2D shapefile

    theView = av.GetActiveDoc
    theDocName = theView.GetClass.GetClassName

    for each t in theView.GetActiveThemes
    if (t.Is(FTheme)) then
    theInFTab = t.GetFTab
    if (theInFTab.GetShapeClass.GetClassName = "MultiPatch") then
    continue
    end
    theShape = theInFTab.GetShapeClass.MakeNull
    fl = {}
    for each f in theInFTab.GetFields
    if (f.IsVisible and f.IsTypeNumber) then
    fl.Add(f)
    end
    end
    outFields = {}
    for each f in theInFTab.GetFields
    if (f.IsVisible and f.IsTypeShape.Not) then
    outFields.Add(f.Clone)
    end
    end

    '-- Get output name
    def = av.GetProject.GetWorkDir.MakeTmp("thm","shp")
    def = SourceManager.PutDataSet(ftab, "Output Shapefile Name :"
    ++ t.GetName, def, true)
    if (def = NIL) then
    continue
    end
    thePrj = Prj.MakeNull
    inClass = theInFTab.GetShapeClass
    if (inClass.IsSubclassOf(PointM)) then
    outClass = Point
    elseif (inClass.IsSubclassOf(LineM)) then
    outClass = Line
    elseif (inClass.IsSubclassOf(RectM)) then
    outClass = Rect
    elseif (inClass.IsSubclassOf(PolygonM)) then
    outClass = Polygon
    elseif (inClass.IsSubclassOf(PolyLineM)) then
    outClass = PolyLine
    elseif (inClass.IsSubclassOf(MultiPointM)) then
    outClass = MultiPoint
    else
    MsgBox.Info("This is not a 3D shape file.","")
    continue
    end
    theOutFTab = FTab.MakeNew(def, outClass)
    theOutFTab.SetEditable(TRUE)
    theOutFTab.AddFields(outFields)
    theBitMap = theInFTab.GetSelection
    if (theBitMap.Count = 0) then
    theBitMap.SetAll
    unsetBitmap = TRUE 'reset flag for end of loop
    else
    unsetBitmap = FALSE
    end
    shapeField = theOutFTab.FindField("Shape")
    done = FALSE
    offset = -1

    while (not done)
    recNum = theBitmap.GetNextSet(offset)
    offset = recNum
    if (recNum <> -1) then
    if (theInFTab.QueryShape(recNum, thePrj, theShape)) then
    rec = theOutFTab.AddRecord
    theOutFTab.SetValue(shapeField, rec, theShape)
    for each f in outFields
    inField = theInFTab.FindField(f.GetAlias)
    attVal = theInFTab.ReturnValue(inField, recNum)
    theOutFTab.SetValue(f, rec, attVal)
    end
    end
    else
    done = TRUE
    end
    end

    theOutFTab.Flush
    theOutFTab.SetEditable(FALSE)
    if (unsetBitmap) then
    theBitmap.ClearAll
    end
    if (MsgBox.YesNo("Add 2D shapefile as theme to the"
    ++ theDocName + "?","Convert to 2D Shapefile :"
    ++ t.GetName,TRUE).Not) then
    continue
    end

    '-- Create a theme and add it to the view
    fthm = FTheme.Make(theOutFTab)
    theView.AddTheme(fthm)
    end
    end

    '-- Bring the View to the front
    theView.GetWin.Activate

  3. Click the Compile button.
    [O-Image] Script compile button

  4. Make the view and theme active.
  5. Click the script window.
  6. Click the Run button.
    [O-Image] Run compiled script button

Article ID:000004235

Software:
  • Legacy Products

Get help from ArcGIS experts

Contact technical support

Download the Esri Support App

Go to download options

Discover more on this topic