private void changeStaticModel(Feature3Ds feature3ds, Feature3D m_feature,GeoModel m_geomodel, string modelpath) { try { Point3D n_point = m_feature.Geometry.InnerPoint3D; Geometry3D m_line = m_geomodel.NodeAnimation.GetTrack(); string modelname = Path.GetFileName(m_geomodel.Name); string n_modelname = modelname.Replace("pao", "zhan"); string n_path = modelpath + "\\" + n_modelname; if(System.IO.File.Exists(n_path)) { feature3ds.Remove(m_feature);
GeoModel n_geomodel = new GeoModel(); n_geomodel.FromFile(n_path, n_point); NodeAnimation ani = n_geomodel.NodeAnimation; ani.SetTrack(m_line); ani.PlayMode = PlayMode.Once; feature3ds.Add(n_geomodel); } } catch (Exception x) { } }
我现在这样来替换。会导致图层管理器崩溃