<?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 rotate by field in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/rotate-by-field/m-p/325184#M25293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day&lt;/P&gt;&lt;P&gt;I have a road layer and a point layer representing villages. The points need to become villages.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="roadandcity.JPG" class="image-1 jive-image" height="244" src="https://community.esri.com/legacyfs/online/68999_roadandcity.JPG" style="width: 309px; height: 243.711290322581px;" width="309" /&gt;&lt;/P&gt;&lt;P&gt;with same tools (buffer, random points tool, etc) I have this so far:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="stad2.JPG" class="image-2 jive-image" height="303" src="https://community.esri.com/legacyfs/online/69002_stad2.JPG" style="width: 350px; height: 302.58064516129px;" width="350" /&gt;&lt;/P&gt;&lt;P&gt;Looks about right but..&lt;/P&gt;&lt;P&gt;-is it possible to have same random on the square width and length?&lt;/P&gt;&lt;P&gt;-is it possible to have the houses align to the roads?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-GB" style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;So far i was looking at script by ET geo wizards “polygon_rotate_byFieldValues.cal”&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;'=========================
'polygon_rotate_byFieldValues.cal
'Author: Ianko Tchoukanski
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.ian-ko.com" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.ian-ko.com&lt;/A&gt;
'=========================
Dim pPolygon As IPolygon
dim pArea As IArea
Dim pOrigin As IPoint
Dim dAngle As Double
Dim pTransform As ITransform2D
Dim Pi as Double
Dim sAngleField
'=======================
'adjust the value below
sAngleField = [Angle]
'=======================
Pi = 4 * Atn(1)
If (Not IsNull([Shape])) Then
&amp;nbsp; Set pPolygon = [Shape]
&amp;nbsp; dAngle = sAngleField*Pi/180
&amp;nbsp; If (Not pPolygon.IsEmpty) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pArea = pPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pOrigin = pArea.Centroid
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTransform = pPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; pTransform.Rotate pOrigin, dAngle
&amp;nbsp; End If
End If
__esri_field_calculator_splitter__
pPolygon&lt;/PRE&gt;&lt;P&gt;looks promising but it is not working&lt;/P&gt;&lt;P&gt;Thank you and greetings Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 11 Dec 2021 15:25:22 GMT</pubDate>
    <dc:creator>PeterVersteeg</dc:creator>
    <dc:date>2021-12-11T15:25:22Z</dc:date>
    <item>
      <title>rotate by field</title>
      <link>https://community.esri.com/t5/python-questions/rotate-by-field/m-p/325184#M25293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good day&lt;/P&gt;&lt;P&gt;I have a road layer and a point layer representing villages. The points need to become villages.&lt;/P&gt;&lt;P&gt;&lt;IMG alt="roadandcity.JPG" class="image-1 jive-image" height="244" src="https://community.esri.com/legacyfs/online/68999_roadandcity.JPG" style="width: 309px; height: 243.711290322581px;" width="309" /&gt;&lt;/P&gt;&lt;P&gt;with same tools (buffer, random points tool, etc) I have this so far:&lt;/P&gt;&lt;P&gt;&lt;IMG alt="stad2.JPG" class="image-2 jive-image" height="303" src="https://community.esri.com/legacyfs/online/69002_stad2.JPG" style="width: 350px; height: 302.58064516129px;" width="350" /&gt;&lt;/P&gt;&lt;P&gt;Looks about right but..&lt;/P&gt;&lt;P&gt;-is it possible to have same random on the square width and length?&lt;/P&gt;&lt;P&gt;-is it possible to have the houses align to the roads?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN lang="EN-GB" style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;So far i was looking at script by ET geo wizards “polygon_rotate_byFieldValues.cal”&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;'=========================
'polygon_rotate_byFieldValues.cal
'Author: Ianko Tchoukanski
&lt;SPAN&gt;'&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.ian-ko.com" rel="nofollow noopener noreferrer" target="_blank"&gt;http://www.ian-ko.com&lt;/A&gt;
'=========================
Dim pPolygon As IPolygon
dim pArea As IArea
Dim pOrigin As IPoint
Dim dAngle As Double
Dim pTransform As ITransform2D
Dim Pi as Double
Dim sAngleField
'=======================
'adjust the value below
sAngleField = [Angle]
'=======================
Pi = 4 * Atn(1)
If (Not IsNull([Shape])) Then
&amp;nbsp; Set pPolygon = [Shape]
&amp;nbsp; dAngle = sAngleField*Pi/180
&amp;nbsp; If (Not pPolygon.IsEmpty) Then
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pArea = pPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pOrigin = pArea.Centroid
&amp;nbsp;&amp;nbsp;&amp;nbsp; Set pTransform = pPolygon
&amp;nbsp;&amp;nbsp;&amp;nbsp; pTransform.Rotate pOrigin, dAngle
&amp;nbsp; End If
End If
__esri_field_calculator_splitter__
pPolygon&lt;/PRE&gt;&lt;P&gt;looks promising but it is not working&lt;/P&gt;&lt;P&gt;Thank you and greetings Peter&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:25:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/rotate-by-field/m-p/325184#M25293</guid>
      <dc:creator>PeterVersteeg</dc:creator>
      <dc:date>2021-12-11T15:25:22Z</dc:date>
    </item>
  </channel>
</rss>

