hendrik0

VBA Add Point so Shape - Zoom Error

Discussion created by hendrik0 on May 4, 2010
Latest reply on May 5, 2010 by hendrik0
Hello,
i just want to add a single Point Feature to a FeatureClass.

If got this Shape File.
Datatyp: Shapefile Feature Class
Shapefile: ...\Adresse.shp
Geometrietyp: Point
Layername:       > 1:2000

    Dim pMxDocument As IMxDocument
    Dim pMap As IMap
    '
    Dim pLayer As ILayer
    Dim pFeatureLayer As IFeatureLayer
    Dim pFeatureClass As IFeatureClass
    Dim pFeature As IFeature
    Dim pPoint As IPoint

    Dim pEditLayers As IEditLayers
    Dim pEditor As IEditor

    Set pMxDocument = Application.Document
    Set pMap = pMxDocument.FocusMap
    
' this Function searches for the layer named ... and returns the ILayer.
    Set pLayer = FindeLayer("> 1:2000", pMap)
    Set pFeatureLayer = pLayer

    Set pFeatureClass = pFeatureLayer.FeatureClass
    
    Set pFeature = pFeatureClass.CreateFeature
    
    Set pPoint = New Point
    
    pPoint.PutCoords gbl_SuchQdr_M_X, gbl_SuchQdr_M_Y
    
    Set pFeature.Shape = pPoint
    
    pFeature.Store
    
    pMxDocument.ActivatedView.Refresh


In the End of this i have a Point added to my shape file. But if i check the layers extends these are not limited to the the point coordinates and if i try to zoom to the layer it's only displayed at a very high range.
If i just delete the point and place it with the ArcGIS Edit function there is no zooming error.
So far i think something is worng with my code - can you help me?

Regards,
Hendrik

Outcomes