I'm facing the same issue. I've ended up writing my own code to extract the profile graphs from a raster. I have a version working for Arc 9.3 and I am in the process of migrating this code over to Arc10. However, I'm having an issue. When trying to get the raster from a IRasterBand data type to the IRasterSurface I get a null return.Here is the code so far:public void GetThicknessData(IRasterLayer rAlamoSurface, IFeatureLayer fThicknessProfile)
{
try
{
IFeature fProfile = fThicknessProfile.FeatureClass.GetFeature(11);
IPointCollection pPointCollection = null;
IPolyline pPolyLine = null;
IGeometry pGeom = null;
Double dCellSize = 30;
IRasterBandCollection pRasterBands = null;
pRasterBands = rAlamoSurface.Raster as IRasterBandCollection;
IRasterBand pRasterBand = pRasterBands.Item(0);
IRasterSurface pRasterSurface = null;
//I get the error here....trying to cast an IRasterBand to an IRasterSurface
//pRasterSurface.RasterBand = pRasterBand as IRasterSurface;
//I've found other VB.net references that use:
//pRasterSurface.RasterBand = pRasterBand;
//In every case I try the pRasterSurface is null.
pRasterSurface = rAlamoSurface.Raster as IRasterSurface;