Sub Point_Grid() Dim pMxDoc As IMxDocument Dim pMap As IMap Dim pActiveView As IActiveView Dim pMapSref As ISpatialReference Dim pFeatureLayer As IFeatureLayer Dim pOutFeatureClass As IFeatureClass Set pMxDoc = ThisDocument Set pMap = pMxDoc.FocusMap Set pActiveView = pMap Set pMapSref = pMap.SpatialReference '======================================================================= Dim ET As New ETGW_Core Dim sOutFileName As String Dim pEnvelope As IEnvelope Set pEnvelope = pActiveView.Extent sOutFileName = "c:\00\point_grid.shp" Set pOutFeatureClass = ET.PointGrid(sOutFileName, pMapSref, _ "Rect", pEnvelope.LowerLeft.X, pEnvelope.LowerLeft.Y, _ 100, 200, 1, 1) If pOutFeatureClass Is Nothing Then Exit Sub End If '======================================================================== Set pFeatureLayer = New FeatureLayer Set pFeatureLayer.FeatureClass = pOutFeatureClass pFeatureLayer.Name = pOutFeatureClass.AliasName pMap.AddLayer pFeatureLayer End Sub