<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Help on creating profile graphs from transects? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388922#M10334</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can created the graph by using the IDataGraphT interface.&amp;nbsp; For each graph, get the surface from the elevation layer (ISurface) and use it to interpolate the z values for the polyline (you must make the polyline z-aware).&amp;nbsp; You can then create a data series on the graph using the z-values from the line.&amp;nbsp; If you like, you can plot all of the data series on the same graph.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Nov 2013 12:27:36 GMT</pubDate>
    <dc:creator>NeilClemmons</dc:creator>
    <dc:date>2013-11-14T12:27:36Z</dc:date>
    <item>
      <title>Help on creating profile graphs from transects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388921#M10333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay so, I am working on ArcGIS 10.1, and Visual Studio 2010.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My objective is to build an add-in that allows for a user to push a button and create a transect (line) in ArcGIS. That line will &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;output&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; profile graph. I know you can do this with 3D analyst, however 3D analyst does not output more than one graph at a time if you &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;have multiple rasters or GRIDS. So I want to be able to have 3 rasters on and create a transect and that transect will output 3 different profiles but of the same line. So far, I have been able to build the add-in up to the point of creating the line. So the code below&amp;nbsp; allows you to draw a line. But now I am stuck in how do I make this line interpolate the data from each raster and output a separate graph? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Geometry;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;
using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace Lab5
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; public class Tool1 : ESRI.ArcGIS.Desktop.AddIns.Tool
&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public Tool1()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

#region "Add Graphic to Map"

///&amp;lt;summary&amp;gt;Draw a specified graphic on the map using the supplied colors.&amp;lt;/summary&amp;gt;
///&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
///&amp;lt;param name="map"&amp;gt;An IMap interface.&amp;lt;/param&amp;gt;
///&amp;lt;param name="geometry"&amp;gt;An IGeometry interface. It can be of the geometry type: esriGeometryPoint, esriGeometryPolyline, or esriGeometryPolygon.&amp;lt;/param&amp;gt;
///&amp;lt;param name="rgbColor"&amp;gt;An IRgbColor interface. The color to draw the geometry.&amp;lt;/param&amp;gt;
///&amp;lt;param name="outlineRgbColor"&amp;gt;An IRgbColor interface. For those geometry's with an outline it will be this color.&amp;lt;/param&amp;gt;
///&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
///&amp;lt;remarks&amp;gt;Calling this function will not automatically make the graphics appear in the map area. Refresh the map area after after calling this function with Methods like IActiveView.Refresh or IActiveView.PartialRefresh.&amp;lt;/remarks&amp;gt;
public void AddGraphicToMap(IMap map, IGeometry geometry, IRgbColor rgbColor, IRgbColor outlineRgbColor)
{
&amp;nbsp; IGraphicsContainer graphicsContainer = (IGraphicsContainer)map; // Explicit Cast
&amp;nbsp; IElement element = null;
&amp;nbsp; if ((geometry.GeometryType) == esriGeometryType.esriGeometryPoint)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Marker symbols
&amp;nbsp;&amp;nbsp;&amp;nbsp; ISimpleMarkerSymbol simpleMarkerSymbol = new SimpleMarkerSymbolClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleMarkerSymbol.Color = rgbColor;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleMarkerSymbol.Outline = true;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleMarkerSymbol.OutlineColor = outlineRgbColor;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleMarkerSymbol.Size = 15;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleMarkerSymbol.Style = esriSimpleMarkerStyle.esriSMSCircle;

&amp;nbsp;&amp;nbsp;&amp;nbsp; IMarkerElement markerElement = new MarkerElementClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; markerElement.Symbol = simpleMarkerSymbol;
&amp;nbsp;&amp;nbsp;&amp;nbsp; element = (IElement)markerElement; // Explicit Cast
&amp;nbsp; }
&amp;nbsp; else if ((geometry.GeometryType) == esriGeometryType.esriGeometryPolyline)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; //&amp;nbsp; Line elements
&amp;nbsp;&amp;nbsp;&amp;nbsp; ISimpleLineSymbol simpleLineSymbol = new SimpleLineSymbolClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleLineSymbol.Color = rgbColor;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleLineSymbol.Style = esriSimpleLineStyle.esriSLSSolid;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleLineSymbol.Width = 5;

&amp;nbsp;&amp;nbsp;&amp;nbsp; ILineElement lineElement = new LineElementClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; lineElement.Symbol = simpleLineSymbol;
&amp;nbsp;&amp;nbsp;&amp;nbsp; element = (IElement)lineElement; // Explicit Cast
&amp;nbsp; }
&amp;nbsp; else if ((geometry.GeometryType) == esriGeometryType.esriGeometryPolygon)
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; // Polygon elements
&amp;nbsp;&amp;nbsp;&amp;nbsp; ISimpleFillSymbol simpleFillSymbol = new SimpleFillSymbolClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleFillSymbol.Color = rgbColor;
&amp;nbsp;&amp;nbsp;&amp;nbsp; simpleFillSymbol.Style = esriSimpleFillStyle.esriSFSForwardDiagonal;
&amp;nbsp;&amp;nbsp;&amp;nbsp; IFillShapeElement fillShapeElement = new PolygonElementClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; fillShapeElement.Symbol = simpleFillSymbol;
&amp;nbsp;&amp;nbsp;&amp;nbsp; element = (IElement)fillShapeElement; // Explicit Cast
&amp;nbsp; }
&amp;nbsp; if (!(element == null))
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp; element.Geometry = geometry;
&amp;nbsp;&amp;nbsp;&amp;nbsp; graphicsContainer.AddElement(element, 0);
&amp;nbsp; }
}
#endregion
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 

#region "Get Polyline From Mouse Clicks"

///&amp;lt;summary&amp;gt;
///Create a polyline geometry object using the RubberBand.TrackNew method when a user click the mouse on the map control. 
///&amp;lt;/summary&amp;gt;
///&amp;lt;param name="activeView"&amp;gt;An ESRI.ArcGIS.Carto.IActiveView interface that will user will interace with to draw a polyline.&amp;lt;/param&amp;gt;
///&amp;lt;returns&amp;gt;An ESRI.ArcGIS.Geometry.IPolyline interface that is the polyline the user drew&amp;lt;/returns&amp;gt;
///&amp;lt;remarks&amp;gt;Double click the left mouse button to end tracking the polyline.&amp;lt;/remarks&amp;gt;
public IPolyline GetPolylineFromMouseClicks(IActiveView activeView)
{

&amp;nbsp; IScreenDisplay screenDisplay = activeView.ScreenDisplay;

&amp;nbsp; IRubberBand rubberBand = new RubberLineClass();
&amp;nbsp; IGeometry geometry = rubberBand.TrackNew(screenDisplay, null);

&amp;nbsp; IPolyline polyline = (IPolyline)geometry;

&amp;nbsp; return polyline;

}
#endregion

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnMouseDown(ESRI.ArcGIS.Desktop.AddIns.Tool.MouseEventArgs
arg)
{
&amp;nbsp;&amp;nbsp;&amp;nbsp; //Get the active view from the ArcMap static class.
&amp;nbsp;&amp;nbsp;&amp;nbsp; IActiveView activeView = ArcMap.Document.ActiveView;

&amp;nbsp;&amp;nbsp;&amp;nbsp; //If it's a polyline object, get from the user's mouse clicks.
&amp;nbsp;&amp;nbsp;&amp;nbsp; IPolyline polyline = GetPolylineFromMouseClicks(activeView);

&amp;nbsp;&amp;nbsp;&amp;nbsp; //Make a color to draw the polyline. 

&amp;nbsp;&amp;nbsp;&amp;nbsp; IRgbColor rgbColor = new RgbColorClass();
&amp;nbsp;&amp;nbsp;&amp;nbsp; rgbColor.Green = 255;

&amp;nbsp;&amp;nbsp;&amp;nbsp; //Add the user's drawn graphics as persistent on the map.

&amp;nbsp;&amp;nbsp;&amp;nbsp; AddGraphicToMap(activeView.FocusMap, polyline, rgbColor, rgbColor);

&amp;nbsp;&amp;nbsp;&amp;nbsp; //Best practice: Redraw only the portion of the active view that contains graphics. 
&amp;nbsp;&amp;nbsp;&amp;nbsp; activeView.PartialRefresh(esriViewDrawPhase.esriViewGraphics, null, null);
}

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; protected override void OnUpdate()
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Enabled = ArcMap.Application != null;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }
&amp;nbsp;&amp;nbsp;&amp;nbsp; }

}
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 03:46:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388921#M10333</guid>
      <dc:creator>WilmerMenjivar</dc:creator>
      <dc:date>2013-11-14T03:46:02Z</dc:date>
    </item>
    <item>
      <title>Re: Help on creating profile graphs from transects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388922#M10334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You can created the graph by using the IDataGraphT interface.&amp;nbsp; For each graph, get the surface from the elevation layer (ISurface) and use it to interpolate the z values for the polyline (you must make the polyline z-aware).&amp;nbsp; You can then create a data series on the graph using the z-values from the line.&amp;nbsp; If you like, you can plot all of the data series on the same graph.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 12:27:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388922#M10334</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2013-11-14T12:27:36Z</dc:date>
    </item>
    <item>
      <title>Re: Help on creating profile graphs from transects?</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388923#M10335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you!&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I understand now, however is there any documentation I could see as an example with using (ISurface) and (IDataGraphT)?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Nov 2013 18:52:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/help-on-creating-profile-graphs-from-transects/m-p/388923#M10335</guid>
      <dc:creator>WilmerMenjivar</dc:creator>
      <dc:date>2013-11-14T18:52:12Z</dc:date>
    </item>
  </channel>
</rss>

