<?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: Rotate Polylines based on Existing Polyline Angles in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334635#M26112</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Randy,&lt;/P&gt;&lt;P&gt;Most are rectangles yes with a few irregular shapes. How would I go about changing this so it would always draw the lines parallel to the most north/south sides? I am not sure if that will work but its worth a shot to try and see how it looks visually.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 14 Jan 2019 23:17:57 GMT</pubDate>
    <dc:creator>AdamThompson3</dc:creator>
    <dc:date>2019-01-14T23:17:57Z</dc:date>
    <item>
      <title>Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334633#M26110</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Everyone,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Currently what I am trying to do is rotate polylines in certain grid sections to the same orientation of existing polylines in that grid. This seems to be quite complicated as I have looked quite extensively for something like this, but to no success. Currently right now I have implemented a tool that was posted here&amp;nbsp;&lt;A class="link-titled" href="https://gis.stackexchange.com/questions/114204/drawing-parallel-lines-inside-polygons-well-paths-using-arcgis-desktop" title="https://gis.stackexchange.com/questions/114204/drawing-parallel-lines-inside-polygons-well-paths-using-arcgis-desktop"&gt;arcpy - Drawing parallel lines inside polygons (Well Paths) using ArcGIS Desktop? - Geographic Information Systems Stack…&lt;/A&gt;&amp;nbsp;&amp;nbsp;now this works for me and does what it should... but here is my problem posted below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433211_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The grid lines that were drawn automatically (yellow) are&amp;nbsp; horizontal where as I would like them be vertical. If there is a way through arcpy or other tools where I can rotate these lines to be the same direction of polylines that are currently there. This is just one example, this happens many times in different areas.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2019 22:17:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334633#M26110</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-14T22:17:15Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334634#M26111</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The tool you mention creates a hull rectangle for each polygon and makes the lines parallel to what is determined as the&amp;nbsp;longest side of the hull rectangle.&amp;nbsp; Are most or all of your polygons rectangles (and not irregular shapes)? If they are rectangles, would you always want the lines parallel to the most north/south sides?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2019 23:06:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334634#M26111</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2019-01-14T23:06:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334635#M26112</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Randy,&lt;/P&gt;&lt;P&gt;Most are rectangles yes with a few irregular shapes. How would I go about changing this so it would always draw the lines parallel to the most north/south sides? I am not sure if that will work but its worth a shot to try and see how it looks visually.&amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 14 Jan 2019 23:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334635#M26112</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-14T23:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334636#M26113</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is some of the code from the stackexchange page (the part where it loops through the polygon feature):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polyFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"SHAPE@"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; spatial_reference&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;SR&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# create inner buffer&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; polyBuff &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;buffer&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;buffNum &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# create hull rectangle to establish a rotated area of interest&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; coordSplit &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;hullRectangle&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;split&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;' '&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# collect corner coordinates&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; coordList &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;3&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;5&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;6&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;7&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordSplit&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# create lines from hull rectangle&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; currentLines &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; pointNum &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;4&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;coordList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getObject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pointNum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getObject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pointNum&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; hullRecLine &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polyline&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;coordList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getObject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pointNum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;coordList&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;getObject&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pointNum&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; currentLines&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;hullRecLine&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# compare first and second line to determine if first line is short or long&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; firstLong &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; currentLines&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; currentLines&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; firstLong &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# calculate number of points needed along short axis&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; numPoints &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; int&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;floor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;currentLines&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;firstLong&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length&lt;SPAN class="operator token"&gt;/&lt;/SPAN&gt;lineSpaceNum&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# create and join points to create parallel lines&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; point &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; range&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;numPoints&lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shortPoint1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; currentLines&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;firstLong&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;positionAlongLine&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lineSpaceNum&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shortPoint2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; currentLines&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;firstLong &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;positionAlongLine&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;currentLines&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;firstLong &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;length &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lineSpaceNum&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parallel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polyline&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;shortPoint1&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;shortPoint2&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; SR&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# intersect parallel lines with buffer&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parallelBuff &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; parallel&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;intersect&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polyBuff&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;2&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parallels&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;parallelBuff&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;In lines 6-17, the code is creating a hull rectangle and getting the lines that make up the rectangle.&amp;nbsp; At lines 20-22, it is comparing the lines to see which side is the long side.&amp;nbsp; The code then goes on to draw the lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you were to compare the starting xy coordinates and ending coordinates of the first and second lines, you should be able to&amp;nbsp;determine which is the most northerly of the lines.&amp;nbsp; Then set the index ( firstLong ) to indicate which line to use.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:51:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334636#M26113</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T15:51:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334637#M26114</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hmm yeah I see what you mean, that could work! Also to note, I just received more data within this grid section where I have been given an ID for the section block and the average azimuth that current polylines that are drawn within it are. For example, BLOCK ID 1, Average Azimuth 347.57. How would I be able to introduce a portion where if the Block ID contains an Azimuth attribute, draw lines with the same spacing currently you set but with the angle that is specified within the table. Any help would be appreciated.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 00:02:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334637#M26114</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-15T00:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334638#M26115</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It should be possible to use the polygon's centroid and draw lines using an azimuth.&amp;nbsp; Several of &lt;A href="https://community.esri.com/migrated-users/3116"&gt;Dan Patterson&lt;/A&gt;‌'s &lt;A href="https://community.esri.com/migration-blogpost/1167"&gt;Py... blog&lt;/A&gt;‌ articles give code examples that might work into this project (or at least, to provide some ideas).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/09/01/distance-calculations-using-the-field-calculator"&gt;Geometry: Points in the field calculator&lt;/A&gt;&lt;/P&gt;&lt;P&gt;(see: &lt;SPAN style="font-size: 15px;"&gt;Line direction or Azimuth to Compass Bearing&lt;/SPAN&gt; and Convert Azimuth to Compass Bearing sections)&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2018/01/21/origin-distances-and-bearings-geometry-wanderings"&gt;Origin, distances and bearings... geometry wanderings&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/09/09/numpy-snippets-3-phishnyet-creating-sampling-grids-using-numpy"&gt;Numpy Snippets # 3 ... Phish_Nyet ... creating sampling grids using numpy and arcpy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A _jive_internal="true" href="https://community.esri.com/blogs/dan_patterson/2016/09/09/n-gons-regular-polygonal-shape-generation"&gt;Hexagons, Rectangles and Triangles... Sampling Frameworks&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 17:59:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334638#M26115</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2019-01-15T17:59:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334639#M26116</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Randy, those are helpful thank you for that! I have kind of narrowed it down to where I need to change the code.&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433219_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;if I could somehow change it where, If I know the azimuth is 347 for example for lines drawn in that section, then I know the lines should be oriented N-S with that degree on them. This has proved to be extremely challenging, at least for my level of python knowledge.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 18:28:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334639#M26116</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-15T18:28:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334640#M26117</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Adam, that is the code that creates the polyline using the existing points etc.&lt;/P&gt;&lt;P&gt;You could... use&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;&lt;STRONG&gt;angleAndDistanceTo (other, {method}) .&lt;/STRONG&gt;..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;from&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/classes/polyline.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/classes/polyline.htm"&gt;Polyline—ArcPy classes | ArcGIS Desktop&lt;/A&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;to find out what the current angle of the polyline is.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;You could use&lt;STRONG&gt;&amp;nbsp;pointFromAngleAndDistance (angle, distance, {method})&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;to replace your 2nd point.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;The only downside I can think of is that you may need to decide whether you are going to rotate the existing polylines from the first point, the middle point or the last point on the existing polyline.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="display: inline !important; float: none; background-color: transparent; color: #4c4c4c; font-family: 'Avenir Next W01','Avenir Next W00','Avenir Next','Avenir','Helvetica Neue',sans-serif; font-size: 14.8px; font-style: normal; font-variant: normal; font-weight: 300; letter-spacing: normal; orphans: 2; text-align: left; text-decoration: none; text-indent: 0px; text-transform: none; -webkit-text-stroke-width: 0px; white-space: normal; word-spacing: 0px;"&gt;My Sampling Frameworks toolset allows you to create polygons... but in your case, you would want rotated rectangles, but you only want 2 of the side... you could at least pull out my code for a look-see to see if you can modify i... I haven't had any use cases for this sort of thing (ie parallel rotated lines, but I will put it on the 'todo' list&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 23:44:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334640#M26117</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-15T23:44:14Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334641#M26118</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan thanks for the suggestions, I will play around with those two functions and see what I can do. I am thinking of not even rotating them, If I could just draw them based on azimuth direction from the start that would be great. I have been provided a table that outlines the grid, each section in that grid has its own ID and the average azimuth within each section. For example&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433422_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I could draw the lines from the start with these azimuth bearings that would be helpful. I have been exploring the other python modules Shapely, and even was able to create bearing lines within QGIS. But I am not sure how to automate it further. I appreciate all the help none the less and am always happy to hear suggestions and ideas. Thanks again&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 Jan 2019 23:53:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334641#M26118</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-15T23:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334642#M26119</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you just want to use the start point of the line and its distance, use it then the second function that allows you to create the rotated line... that makes more sense since you are still within one package or&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-geometry-attributes.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/add-geometry-attributes.htm"&gt;Add Geometry Attributes—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; to get the bearings and start end coordinates... keep the start point... change the bearings then&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/bearing-distance-to-line.htm" title="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/bearing-distance-to-line.htm"&gt;Bearing Distance To Line—Data Management toolbox | ArcGIS Desktop&lt;/A&gt;&amp;nbsp; to complete the process&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 00:15:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334642#M26119</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-16T00:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334643#M26120</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan, These links and suggestions were super helpful! Ive been able to at least rotate them now and this is the fartheset I have been yet! The only problem I am facing currently is those starting points. For example, If my lines are going vertical but I want them to be horizontal, I need to change that starting point to a different line or else it looks like this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/433495_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;Now I believe I have the correct logic on how to fix this problem, but how to put into code is another story haha. I will use a search cursor on the grid shapefile to search for the azimuth angle lines in that grid should be drawn at. I will give ranges after in a If statement saying If row[0] = 90 (for example), I will plot my starting points on the West or East side of the polygon cause then I know they will be drawn horizontally.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Where I am stuck is distinguishing which side is west, east, north, south on each feature I iterate through, and then assigning that as my line where I plot the first starting points. After that I can do the add geometry, bearing distance and I think I will have solved my problem.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:04:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334643#M26120</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-16T20:04:25Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334644#M26121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;To update this*** I was looking it further and it creates Polylines with the shape of the polygon actually instead of a polygon which could make it more troublesome to determine&amp;nbsp;E,W,N,S.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:15:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334644#M26121</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-16T20:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334645#M26122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's some code that I have been experimenting with that may give you some ideas.&amp;nbsp; It takes a polygon feature class and creates a layer of points marking each polygon's centroid.&amp;nbsp; It also creates a line through the centroid at a given azimuth.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="polygons" class="image-1 jive-image j-img-original" src="https://community.esri.com/legacyfs/online/433508_poly.png" /&gt;&lt;/P&gt;&lt;P&gt;From here, you need to add additional parallel lines and clip them to the polygon.&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; arcpy
&lt;SPAN class="keyword token"&gt;import&lt;/SPAN&gt; math

&lt;SPAN class="keyword token"&gt;def&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;draw_line&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; distance&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; bearing&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; angle &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;90&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; bearing
&amp;nbsp;&amp;nbsp;&amp;nbsp; bearing &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;radians&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bearing&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; angle &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;radians&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;angle&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cosa &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;cos&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;angle&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; cosb &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; math&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;cos&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;bearing&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; x1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y1 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;distance &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; cosa&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; point&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;distance &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; cosb&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; x2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y2 &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; \
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;point&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;distance &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; cosa&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; point&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;-&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;distance &lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt; cosb&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;x1&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y1&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;x2&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; y2&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

polyFC &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;"poly_line"&lt;/SPAN&gt; &lt;SPAN class="comment token"&gt;# the polygon feature layer&lt;/SPAN&gt;
azimuth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;347&lt;/SPAN&gt;

desc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Describe&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polyFC&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
SR &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; desc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;spatialReference
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;overwriteOutput &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="token boolean"&gt;True&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;outputCoordinateSystem &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; SR

points &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
lines &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polyFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centroid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;centroid
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PointGeometry&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; part &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; pnt &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; part&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&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; cent_vert_dist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PointGeometry&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;pnt&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;distanceTo&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&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; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; cent_vert_dist &lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; dist&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&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; dist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; cent_vert_dist
&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; &lt;SPAN class="comment token"&gt;# far_point = arcpy.PointGeometry(pnt)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;# points.append(far_point)&lt;/SPAN&gt;

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; feature_info &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt; draw_line&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;X&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; centroid&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Y&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; dist&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; azimuth&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; feature &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; feature_info&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; lines&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&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; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Polyline&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;
&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; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Array&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Point&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;*&lt;/SPAN&gt;coords&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; coords &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; feature&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;points&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'in_memory\points'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;CopyFeatures_management&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;lines&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'in_memory\lines'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:51:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334645#M26122</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T15:51:08Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334646#M26123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Randy, Awesome script!! I am wondering now if this might be easier to implement then my previous one, or try and incorporate pieces of both. If I could keep the option parameter of spacing between lines somewhere that would be ideal. This is awesome though, I did not even think of drawing from a points centroid.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 20:30:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334646#M26123</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-16T20:30:42Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334647#M26124</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just some thoughts...&lt;/P&gt;&lt;P&gt;Distance is measured in the units of the spatial reference so you may need to do some conversion.&amp;nbsp; Depending upon false northing value in the spatial reference, you may&amp;nbsp;wish to adjust your azimuth setting.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For distance between lines, you would need to calculate&amp;nbsp;an x value offset.&amp;nbsp; With the desired distance being one side of a right triangle that is perpendicular to the line, you would use the hypotenuse value as an x offset.&amp;nbsp; Adding/subtracting this value&amp;nbsp;from the x value at the ends of the first line should provide parallel lines at the proper distance&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you have an odd number of lines, you can draw the first line through the centroid.&amp;nbsp; If you want an even number of lines, use half the x offset value to move the first line to the right or left of the centroid and then add the rest of your lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 22:22:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334647#M26124</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2019-01-16T22:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334648#M26125</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Randy this helps a lot, awesome script! I am tweaking it just a bit where instead of one singular azimuth to go off of, I would like to pull my azimuth value from a field within the polygon shapefile. I have been attempting to use a search cursor to look on that field and then say row=azimuth, but have not been successful! What I get is this...&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="433506" class="image-1 jive-image" height="207" src="https://community.esri.com/legacyfs/online/433506_pastedImage_1.png" width="429" /&gt;&lt;/P&gt;&lt;P&gt;Here is the portion of code I tweaked;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="433507" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/433507_pastedImage_2.png" /&gt;&lt;/P&gt;&lt;P&gt;Perhaps my syntax is a bit wonky somewhere. Thank you again for everything&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also This is what I am trying to pull as my azimuth value&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://community.esri.com/legacyfs/online/433529_pastedImage_1.png" /&gt;&lt;/P&gt;&lt;P&gt;each shape it iterates through should draw lines based on this value.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 22:33:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334648#M26125</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-16T22:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334649#M26126</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You need the geometry field&amp;nbsp;(SHAPE@) in the search cursor&amp;nbsp;for the centroid.&lt;/P&gt;&lt;P&gt;Untested, but try something like (note code changes in rows&amp;nbsp;2 and 6):&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;# ... &lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;with&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;da&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;SearchCursor&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;polyFC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'SHAPE@'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'AVGAzimuth'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; row &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; cursor&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; centroid &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;centroid
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; points&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;append&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;PointGeometry&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;centroid&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; azimuth &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;1&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; part &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; row&lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="number token"&gt;0&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;# ...‍‍‍‍‍‍‍‍‍&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:51:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334649#M26126</guid>
      <dc:creator>RandyBurton</dc:creator>
      <dc:date>2021-12-11T15:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334650#M26127</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yup that worked perfectly! I really can't thank you guys enough for all this help, still a beginner id say in this world and learn so much from individuals such as yourself! Thank you very much. Next steps now are I just have to copy the lines on both sides and try and figuring out the spacing with the logic you provided!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Jan 2019 22:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334650#M26127</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-16T22:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334651#M26128</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;interesting problem... if anyone needs to start lines from scratch, I documented an alternate line forming process to cover some of these ideas and some other thoughts&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.esri.com/blogs/dan_patterson/2019/01/17/transect-lines-parallel-lines-offset-lines"&gt;/blogs/dan_patterson/2019/01/17/transect-lines-parallel-lines-offset-lines&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 17 Jan 2019 07:18:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334651#M26128</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2019-01-17T07:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Rotate Polylines based on Existing Polyline Angles</title>
      <link>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334652#M26129</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Dan, wow this awesome!! Pretty sure exactly the last step I need, but I am struggling a bit with integrating it into my current script. So currently I am iterating through each grid shape, finding the center point and drawing a line based on a azimuth that is given to me. That is all good, now I would like to take that current line and replicate it X number of times and a X distance from it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I see that your scipt indeed does this! I am not sure If I understand all the logic and code that is happening, there is a lot going on and I am not sure If I am to use all of it or only pieces. Given that I have already created a line, can I Incorporate some portions of your script where I am still iterating through each grid creating a line and replicating it. So it shows something like this (replicates created manually)&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="433672" class="image-1 jive-image" height="291" src="https://community.esri.com/legacyfs/online/433672_pastedImage_2.png" width="615" /&gt;&lt;/P&gt;&lt;P&gt;I am essentially trying to keep it all within one loop and trying to incorporate your code in this area of mine;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG __jive_id="433682" class="image-2 jive-image" src="https://community.esri.com/legacyfs/online/433682_pastedImage_3.png" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you again for all the help, I am still looking at your code and trying to understand how I can implement it into mine. I am using the script Randy provided above with just a slight modification where I am grabbing the azimuth attribute from the table of the grid shapefile.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Jan 2019 16:37:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-polylines-based-on-existing-polyline-angles/m-p/334652#M26129</guid>
      <dc:creator>AdamThompson3</dc:creator>
      <dc:date>2019-01-18T16:37:30Z</dc:date>
    </item>
  </channel>
</rss>

