This is what I've come up with. The issue I have is that the raster doesn't actually "appear" until the cursor is updated by me moving the cursor off the view or I hit a "reset" (I'm doing the attach in _OnDataButton() of a DgnPrimitiveTool)
DgnDocumentMonikerPtr moniker = DgnDocumentMoniker::CreatePortableMoniker(NULL, fullFileName.GetName(), NULL, NULL, NULL, DgnPlatform::RelativePathPreference::CreateIfPossible); DgnRasterStatus rStatus; DgnRasterOpenParamsPtr openParams = DgnRasterOpenParams::Create(moniker, true); DgnRasterPtr dgnRaster=DgnRaster::Create( rStatus, *openParams, *ISessionMgr::GetActiveDgnModelRefP()); dgnRaster->SetGCSInheritedFromModelState(false); GeoCoordinates::DgnGCSPtr dgnGCS = Bentley::GeoCoordinates::DgnGCS::CreateGCS(L"UTM27-17", ACTIVEMODEL); dgnRaster->SetDgnGCS( dgnGCS.get() ); dgnRaster->AddToModel();
Bruce