首页 / 浏览问题 / 组件GIS / 问题详情
.Net组件自适应管点问题
216EXP 2018年07月25日

Layer3D.SetParentLayer(Layer3D value);设置过了但是其值总是为false,也就是管点和管线不存在父子关系?

 bool isParent = false;
 Theme3DCustom theme = new Theme3DCustom();
 FieldInfos fieldinfos = pipePoint.FieldInfos;
 foreach (FieldInfo fieldInfo in fieldinfos)
 {
   if (fieldInfo.Name.ToString() == "MarkSymbolID")
   {
     theme.MarkerSymbolIDExpression = fieldInfo.Name.ToString();
      }
   if (fieldInfo.Name.ToString() == "Mark3DScaleX")
   {
     theme.Marker3DScaleXExpression = fieldInfo.Name.ToString();
       }
   if (fieldInfo.Name.ToString() == "Mark3DScaleY")
     {
     theme.Marker3DScaleYExpression = fieldInfo.Name.ToString();
   }
   if (fieldInfo.Name.ToString() == "Mark3DScaleZ")
   {
    theme.Marker3DScaleZExpression = fieldInfo.Name.ToString();
   }
   if (fieldInfo.Name.ToString() == "AltitudeMode")
   {
    theme.AltitudeModeExpression = fieldInfo.Name.ToString();
    }
 }
 PrjCoordSys prjCoordSys = new PrjCoordSys(PrjCoordSysType.Xian19803DegreeGk39N);
 pipePoint.PrjCoordSys = prjCoordSys;
 Layer3DDataset layerPipePoint = m_sceneControl.Scene.Layers.Add(pipePoint, theme, true);
//必须设置透明度才能显示管线数据
 m_sceneControl.Scene.GlobalImage.Transparency = 100;
Layer3D ysPoint = layerPipePoint as Layer3D;
  Layer3D ysParent = null;
 for (int i = 0; i < m_sceneControl.Scene.Layers.Count; i++)
 {
   Layer3D layer3D = m_sceneControl.Scene.Layers[i];
   if (layer3D.Name.ToString().Trim() == "Line3D@data")
   {
      ysParent = layer3D;
   }
 }
 if (ysPoint != null && ysParent != null)
  {
    isParent = ysPoint.SetParentLayer(ysParent);
  }
  if (isParent)
     MessageBox.Show("存在父子关系");
  else
  {
     MessageBox.Show("不存在父子关系");
    }
  layerPipePoint.PipeLayerSetting.MatchSymMatchMode = ModelSymbolMatchMode.AlignPipeLine;
    m_sceneControl.Refresh();

1个回答

您好!您打断点调试一下您的代码,看能否运行到if语句里的isParent。
3,352EXP 2018年07月25日

可以运行到if语句的isParent,但是始终未false,三维网络点和线的高度模式设置的是一致的;

layerPipePoint.PipeLayerSetting.MatchSymMatchMode = ModelSymbolMatchMode.AlignPipeLine;也设置了。

但是仍然显示不了自适应管点(三通、四通等)。

桌面端为什么设置不了关联图层呢?

您好!您所说的设置关联图层是指关联浏览属性数据吗?没有找到您所说的这个功能。
...