IMarker3DSymbol pMarker3DSymbol = new Marker3DSymbolClass();
string filePath = @"E:\TestSoft\WindowsFormsGis\bin\Release\1.3ds";
IImport3DFile import3Dfile = new Import3DFileClass();
pMarker3DSymbol.CreateFromFile(filePath);
ISymbol pSymbol = pMarker3DSymbol as ISymbol;
if (pSymbol == null)
{
System.Windows.Forms.MessageBox.Show("pSymbol == null");
}
ISimpleRenderer pRender = new SimpleRendererClass();
IGeoFeatureLayer pGFlayer = (IGeoFeatureLayer)layer;
pGFlayer.Renderer = (IFeatureRenderer)pUVRender;
axSceneControl1.SceneGraph.RefreshViewers();
this.axSceneControl1.Refresh();
为什么不能符号化成功
这有很多可能,比如说你的模型文件本身是否合法,axSceneControl控件本身有没有问题,去掉try catch(如果有的话),看下报什么异常。
axSceneControl1.SceneViewer.Redraw(true);
axSceneControl1.Scene.SceneGraph.RefreshViewers();
axSceneControl1.SceneGraph.RefreshViewers();
缺少一个刷新。。