<?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 Parallel Polylines with VBA in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111235#M2914</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a VBA routine, where the user clicks on a polyline and the coordinates are returned. X1, Y1, X2 and Y2. I also have a routine to draw a line between these coordinates. How do I draw the polyline parallel to the original line, which is offset by the same distance, regardless of the zoom factor? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lawrence&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 23 Sep 2010 18:51:58 GMT</pubDate>
    <dc:creator>LawrenceHughes</dc:creator>
    <dc:date>2010-09-23T18:51:58Z</dc:date>
    <item>
      <title>Parallel Polylines with VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111235#M2914</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a VBA routine, where the user clicks on a polyline and the coordinates are returned. X1, Y1, X2 and Y2. I also have a routine to draw a line between these coordinates. How do I draw the polyline parallel to the original line, which is offset by the same distance, regardless of the zoom factor? &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lawrence&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 18:51:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111235#M2914</guid>
      <dc:creator>LawrenceHughes</dc:creator>
      <dc:date>2010-09-23T18:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel Polylines with VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111236#M2915</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use IConstructCurve.ConstructOffset.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Sep 2010 20:11:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111236#M2915</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-09-23T20:11:59Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel Polylines with VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111237#M2916</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Neil&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;After a lot of surfing around, I found the following example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;______________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Function ConstructOffset(pInPolyline As IPolyline, dOffset As Double) As IPolyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pConstructCurve As IConstructCurve&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error GoTo ErrorHandler&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If pInPolyline Is Nothing Or pInPolyline.IsEmpty Then Exit Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pConstructCurve = New Polyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pConstructCurve.ConstructOffset pInPolyline, dOffset, esriConstructOffsetRounded + esriConstructOffsetSimple&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set ConstructOffset = pConstructCurve&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exit Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;ErrorHandler:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set ConstructOffset = Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;______________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is my line drawing function. I can't get my function to correctly call the above function. Can you see what is wrong?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;______________&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Private Function DrawLine(x1, y1, x2, y2, aView As IActiveView, pMap, LineName)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;On Error GoTo err_handler&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPointCollection As IPointCollection&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pFromPoint As ipoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pToPoint As ipoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pPolyline As IPolyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pFromPoint = New Point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pToPoint = New Point&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pLineSym As ISimpleLineSymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pLineElement As ILineElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pFromPoint.PutCoords x1, y1&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pToPoint.PutCoords x2, y2&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pPolyline = New Polyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pPointCollection = New Polyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set oPointCollection = New Polyline&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pPointCollection.AddPoint pFromPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pPointCollection.AddPoint pToPoint&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pGC As IGraphicsContainer&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pGC = pMap&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim pElement As IElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim oElement As IElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim oLineElement As ILineElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pElement = New LineElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set oElement = New LineElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;pElement.Geometry = pPointCollection&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim oLineSym As ISimpleLineSymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim SymCol As IRgbColor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pLineElement = pElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set oLineElement = oElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set pLineSym = New SimpleLineSymbol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLineSym.Style = esriSLSSolid&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLineSym.Width = 3&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set SymCol = New RgbColor&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;SymCol.Blue = 255&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLineSym.Color = SymCol&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pLineElement.Symbol = pLineSym&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;oLineElement = ConstructOffset(pPointCollection, 100)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Dim elemProps As IElementProperties&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Set elemProps = pLineElement&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;elemProps.Name = LineName&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pGC.AddElement pLineElement, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pGC.AddElement oLineElement, 0&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;aView.PartialRefresh esriViewGraphics, Nothing, Nothing&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Exit Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;err_handler:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;MsgBox Err &amp;amp; " - " &amp;amp; Error$&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Resume&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;______________&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 18:53:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111237#M2916</guid>
      <dc:creator>LawrenceHughes</dc:creator>
      <dc:date>2010-09-24T18:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel Polylines with VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111238#M2917</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Your ConstructOffset function returns a polyline.&amp;nbsp; You're trying to set a line element equal to that polyline.&amp;nbsp; That won't work as it is a type mismatch.&amp;nbsp; You need to set your element's geometry to be the polyline returned by the ConstructOffset function.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Sep 2010 19:23:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111238#M2917</guid>
      <dc:creator>NeilClemmons</dc:creator>
      <dc:date>2010-09-24T19:23:00Z</dc:date>
    </item>
    <item>
      <title>Re: Parallel Polylines with VBA</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111239#M2918</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Sorry Neil (or anyone else), my last reply should have read, how can I change my code to return a polyline and not an element? I am struggling with the concepts here.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Many thanks&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 25 Sep 2010 09:23:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111239#M2918</guid>
      <dc:creator>LawrenceHughes</dc:creator>
      <dc:date>2010-09-25T09:23:07Z</dc:date>
    </item>
    <item>
      <title>Parallel Polylines with VBA which stay the same distance apart, regardless of zoom</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111240#M2919</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The above code is now working. What I really need is to create two parallel lines, which stay the same distance apart whether the user zooms in or out. Is this possible?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Lawrence&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 04 Oct 2010 19:16:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/parallel-polylines-with-vba/m-p/111240#M2919</guid>
      <dc:creator>LawrenceHughes</dc:creator>
      <dc:date>2010-10-04T19:16:51Z</dc:date>
    </item>
  </channel>
</rss>

