IRasterMakerOp.MakeConstant method

571
0
03-09-2011 08:58 AM
TanaHaluska
New Contributor
Hello,
I attempted to use this code to create a grid from a constant (4137.37). I have inserted a MsgBox in the snippet where I get an error.  The error message is:

Error HRESULT E_FAIL has been returned from a call to a COM component.

Can anyone tell me what I am doing wrong?
thanks
tlh

'make stagegrid using IRasterMakerOp.MakeConstant method:
'StageMeters is a variable containing the value of 4137.37
Dim pRMakerOp As ESRI.ArcGIS.GeoAnalyst.IRasterMakerOp = New RasterMakerOp
Dim pStageGrid As IGeoDataset = pRMakerOp.MakeConstant(StageMeters, False)
Dim pLayerStage As IRasterLayer = New RasterLayer
MsgBox("Code is good up to here")
pLayerStage.CreateFromRaster(pStageGrid)
pLayerStage.Name = "StageGrid"
pMap.AddLayer(pStageGrid)
pMxDoc.ActiveView.Refresh()
0 Kudos
0 Replies