时间:2015-1-30 作者:悬浮的青春 分类: skyline二次开发
直接贴代码了。
string tMsg = String.Empty;
ILayer6 cFeatureLayer = null;
IFeatureGroups6 cFeatureLayerGroups = null;
IFeatureGroup6 cFeatureGroupPoint = null;
SGWorld sg = new SGWorld();
string tShapeFileName = Application.StartupPath + @"\"+FilePath+@"\" + ExportFileShortName + ".shp";
string tConnectionString = String.Format("FileName={0};TEPlugName=OGR;", tShapeFileName);
cFeatureLayer = sg.Creator.CreateFeatureLayer("路径"+DateTime.Now.ToString(), tConnectionString, groupid);
cFeatureLayer.Streaming = false;
sg.ProjectTree.SelectItem(cFeatureLayer.TreeItem.ItemID, 0, 0);
cFeatureLayerGroups = cFeatureLayer.FeatureGroups;
cFeatureGroupPoint = cFeatureLayerGroups.Polyline;
cFeatureGroupPoint.DisplayAs = ObjectTypeCode.OT_POLYLINE;
cFeatureLayer.Load();
cFeatureLayer.Refresh();
//sg.ProjectTree.SetVisibility(cFeatureLayer.TreeItem.ItemID, true);
cFeatureGroupPoint.SetProperty("Line Color", Color.Blue.ToArgb());//红色
cFeatureGroupPoint.SetProperty("Line Width", 10);//线段宽度
cFeatureGroupPoint.SetProperty("Altitude Method", AltitudeTypeCode.ATC_TERRAIN_RELATIVE);
cFeatureGroupPoint.SetProperty("Altitude", 2.0);
cFeatureLayer.Refresh();
标签: skyline