christkl

How to get non ZAware polygons into a ZAware polygon featureclass

Discussion created by christkl on Sep 6, 2011
Latest reply on Sep 6, 2011 by christkl
I've buffered a line feature class and need to get the resulting polygons into a ZAware feature class. My lines are ZAware, but the buffering seems to make non ZAware features, so I get an error trying to enter them into my ZAware feature class.
I've tried entering them into a non ZAware polygon feature class, which works fine, but then I get a problem trying to copy those into my ZAware polygon feature class.
The ZAware polygon feature class is an existing featureclass that is part of a data model, so it's not created by code, meaning that I can't just make a non ZAware polygon feature class instead.

The error messages that I get is either "No spatial reference exist" which is a misleading messages since it's got nothing to do with spatial reference, the other one is "The geometry has null Z values". It changes between these two error messages depending on wheter pZAware.ZAware = False or True.

Copying the non ZAware polygons into the ZAware polygon feature class in ArcMap works fine, so it's got to be possible doing it with ArcObjects as well.

Will be really grateful for some input on this!


[HTML]pFeatureCur = pLineFC.Search(Nothing, True)
        pLineFeat = pFeatureCur.NextFeature

        Do Until pLineFeat Is Nothing
            pPolyline = pLineFeat.Shape
            pTopo = pPolyline
            pPolygon = pTopo.Buffer(dBuffer)
            pPolyFeat = pSSDMFC.CreateFeature
            pZAware = pPolygon
            pZAware.ZAware = True
           
            pPolyFeat.Shape = pPolygon
            pPolyFeat.Store()
            pLineFeat = pFeatureCur.NextFeature
        Loop[/HTML]

Outcomes