使用产品:object 9D 2019 操作系统:win10 x64
数据类型: 文件型
问题详细描述:
1.使用代码在KML图层或者追踪图层中增加3DS模型,并设置Style3D.MarkerSymbolID值.但是点击事件中无法获取对应MarkerSymbolID值的模型
插入模型代码:
GeoStyle3D Geostyle3D = new GeoStyle3D();
Geostyle3D.AltitudeMode = AltitudeMode.Absolute;
Geostyle3D.FillForeColor = Color.Red;
Geostyle3D.FillBackColor = Color.Red;
Geostyle3D.MarkerScale = 1;
Geostyle3D.IsMarkerSizeFixed = true;
Geostyle3D.MarkerSymbolID = index++;
//构造三维体对象
GeoModel Geomodel = new GeoModel();
Geomodel.FromFile(@"D:\1111111.3DS");
Geomodel.Position = new Point3D(pt3d.X, pt3d.Y, pt3d.Z + 7);
Geomodel.SetEmpty();
Geomodel.ID = index++;
Geomodel.Style3D = Geostyle3D;
Geomodel.Style.MarkerSymbolID = index++;
// 构造一个三维几何地标对象并对其属性进行设置
GeoPlacemark geoPlacemark = new GeoPlacemark();
geoPlacemark.Name = "质量问题";
geoPlacemark.Geometry = Geomodel;
geoPlacemark.NameStyle = new TextStyle();
geoPlacemark.ID = index++;
// 将三维地标几何对象添加到几何要素中
Feature3Ds feature3Ds = _kml.Features;
var feature3D = feature3Ds.Add(Geomodel);
_kml.UpdateData();
点击事件代码:
//Select ed object
if (e.Count > 0)
{
var selection3d = _sceneControl.Scene.FindSelection(true);
var sd = selection3d[0].Style;
Int32 id = sd.MarkerSymbolID;
if (id > 0)
{
}
}
点击事件中sd.MarkerSymbolID始终等于0;
2.还有如何使用代码将导入的模型焦点高亮;