ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / LineOfSightResult Class / InvisibleLine Property
Example

In This Topic
    InvisibleLine Property
    In This Topic
    Gets the invisible part(s), if any, of the surface profile, from the perspective of the observer point when looking towards the target point.
    Syntax
    public Polyline InvisibleLine {get;}
    Public ReadOnly Property InvisibleLine As Polyline
    Remarks
    InvisibleLine can be null - meaning there is no obstruction along the sight line. It will be projected to the LineOfSightParams.OutputSpatialReference or the spatial reference of the surface if LineOfSightParams.OutputSpatialReference is null.
    Example
    Get Line of Sight
    var losParams = new LineOfSightParams();
    losParams.ObserverPoint = observerPoint;
    losParams.TargetPoint = targetPoint;
    
    // add offsets if appropriate
    // losParams.ObserverHeightOffset = observerOffset;
    // losParams.TargetHeightOffset = targerOffset;
    
    // set output spatial reference
    losParams.OutputSpatialReference = MapView.Active.Map.SpatialReference;
    
    LineOfSightResult results = null;
    try
    {
      if (tinLayer.CanGetLineOfSight(losParams))
        results = tinLayer.GetLineOfSight(losParams);
    }
    catch (Exception ex)
    {
      // log exception message
    }
    
    if (results != null)
    {
      bool targetIsVisibleFromObserverPoint = results.IsTargetVisibleFromObserverPoint;
      bool targetVisibleFromVisibleLine = results.IsTargetVisibleFromVisibleLine;
      bool targetVisibleFromInVisibleLine = results.IsTargetVisibleFromInvisibleLine;
    
    
      if (results.VisibleLine != null)
        MapView.Active.AddOverlay(results.VisibleLine, visibleLineSymbol.MakeSymbolReference());
      if (results.InvisibleLine != null)
        MapView.Active.AddOverlay(results.VisibleLine, invisibleLineSymbol.MakeSymbolReference());
      if (results.ObstructionPoint != null)
        MapView.Active.AddOverlay(results.ObstructionPoint, obstructionPointSymbol.MakeSymbolReference());
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.2 or higher.
    See Also