<?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 Model Builder: how to use a Script output as an input for a Toolbar in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-how-to-use-a-script-output-as-an/m-p/1616005#M95863</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I &lt;/SPAN&gt;&lt;SPAN class=""&gt;now &lt;/SPAN&gt;&lt;SPAN class=""&gt;have &lt;/SPAN&gt;&lt;SPAN class=""&gt;a &lt;/SPAN&gt;&lt;SPAN class=""&gt;script &lt;/SPAN&gt;&lt;SPAN class=""&gt;that &lt;/SPAN&gt;&lt;SPAN class=""&gt;extends &lt;/SPAN&gt;&lt;SPAN class=""&gt;a L&lt;/SPAN&gt;&lt;SPAN class=""&gt;ine &lt;/SPAN&gt;&lt;SPAN class=""&gt;to &lt;/SPAN&gt;&lt;SPAN class=""&gt;the &lt;/SPAN&gt;&lt;SPAN class=""&gt;edge &lt;/SPAN&gt;&lt;SPAN class=""&gt;of &lt;/SPAN&gt;&lt;SPAN class=""&gt;a P&lt;/SPAN&gt;&lt;SPAN class=""&gt;olygon (&lt;/SPAN&gt;&lt;SPAN class=""&gt;see &lt;/SPAN&gt;&lt;SPAN class=""&gt;my &lt;/SPAN&gt;&lt;SPAN class=""&gt;previous &lt;/SPAN&gt;&lt;SPAN class=""&gt;post), &lt;/SPAN&gt;&lt;SPAN class=""&gt;and &lt;/SPAN&gt;&lt;SPAN class=""&gt;I &lt;/SPAN&gt;&lt;SPAN class=""&gt;would &lt;/SPAN&gt;&lt;SPAN class=""&gt;like &lt;/SPAN&gt;&lt;SPAN class=""&gt;to &lt;/SPAN&gt;&lt;SPAN class=""&gt;use &lt;/SPAN&gt;&lt;SPAN class=""&gt;this &lt;/SPAN&gt;&lt;SPAN class=""&gt;extended L&lt;/SPAN&gt;&lt;SPAN class=""&gt;ine &lt;/SPAN&gt;&lt;SPAN class=""&gt;as &lt;/SPAN&gt;&lt;SPAN class=""&gt;input &lt;/SPAN&gt;&lt;SPAN class=""&gt;for &lt;/SPAN&gt;&lt;SPAN class=""&gt;another T&lt;/SPAN&gt;&lt;SPAN class=""&gt;oolbar — &lt;/SPAN&gt;&lt;SPAN class=""&gt;specifically, &lt;/SPAN&gt;&lt;SPAN class=""&gt;in "&lt;/SPAN&gt;&lt;SPAN class=""&gt;Create &lt;/SPAN&gt;&lt;SPAN class=""&gt;a &lt;/SPAN&gt;&lt;SPAN class=""&gt;TIN" &lt;/SPAN&gt;&lt;SPAN class=""&gt;as &lt;/SPAN&gt;&lt;SPAN class=""&gt;a "&lt;/SPAN&gt;&lt;SPAN class=""&gt;Soft &lt;/SPAN&gt;&lt;SPAN class=""&gt;Line." &lt;/SPAN&gt;&lt;SPAN class=""&gt;Does &lt;/SPAN&gt;&lt;SPAN class=""&gt;anyone &lt;/SPAN&gt;&lt;SPAN class=""&gt;know &lt;/SPAN&gt;&lt;SPAN class=""&gt;how &lt;/SPAN&gt;&lt;SPAN class=""&gt;I &lt;/SPAN&gt;&lt;SPAN class=""&gt;can &lt;/SPAN&gt;&lt;SPAN class=""&gt;do &lt;/SPAN&gt;&lt;SPAN class=""&gt;this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DonatellaMarino1_0-1747662591276.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/132499iB924642600B1B444/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DonatellaMarino1_0-1747662591276.png" alt="DonatellaMarino1_0-1747662591276.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hier what I'm missing: since I can't connect two Processes, I don't know how I can proceed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hier there is my Script:&lt;BR /&gt;import arcpy&lt;BR /&gt;import math&lt;BR /&gt;&lt;BR /&gt;dist = 500&amp;nbsp;&lt;BR /&gt;fc_line = arcpy.GetParameterAsText(0)&amp;nbsp;&lt;BR /&gt;fc_poly = arcpy.GetParameterAsText(1)&amp;nbsp;&lt;BR /&gt;output_fc = arcpy.GetParameterAsText(2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;temp_fc = "in_memory/temp_fc"&lt;BR /&gt;arcpy.CopyFeatures_management(fc_line, temp_fc)&lt;BR /&gt;with arcpy.da.SearchCursor(fc_poly, "SHAPE@") as scur:&lt;BR /&gt;for poly, in scur:&lt;BR /&gt;boundary = poly.boundary()&lt;BR /&gt;arcpy.SelectLayerByLocation_management(temp_fc, "WITHIN", poly)&lt;BR /&gt;with arcpy.da.UpdateCursor(temp_fc, "SHAPE@") as ucur:&lt;BR /&gt;for line, in ucur:&lt;BR /&gt;arr, = line.getPart()&lt;BR /&gt;SR = line.spatialReference # Räumliche Referenz der Linie&lt;BR /&gt;p1, p2 = arr[:2]&amp;nbsp;&lt;BR /&gt;angle = math.atan2(p2.Y - p1.Y, p2.X - p1.X)&amp;nbsp;&lt;BR /&gt;p = arcpy.Point(p1.X - dist * math.cos(angle), p1.Y - dist * math.sin(angle))&amp;nbsp;&lt;BR /&gt;arr.insert(0, p)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;pn1, pn = arr[-2:]&amp;nbsp;&lt;BR /&gt;angle = math.atan2(pn.Y - pn1.Y, pn.X - pn1.X)&amp;nbsp;&lt;BR /&gt;p = arcpy.Point(pn.X + dist * math.cos(angle), pn.Y + dist * math.sin(angle))&amp;nbsp;&lt;BR /&gt;arr.append(p)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;line = arcpy.Polyline(arr, SR)&amp;nbsp;&lt;BR /&gt;line = line.cut(boundary)[1]&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;ucur.updateRow([line])&lt;BR /&gt;&lt;BR /&gt;arcpy.CopyFeatures_management(temp_fc, output_fc)&lt;BR /&gt;arcpy.Delete_management(temp_fc)&lt;BR /&gt;arcpy.SetParameterAsText(2, output_fc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any Tipps,&lt;/P&gt;&lt;P&gt;Donatella&lt;/P&gt;</description>
    <pubDate>Tue, 20 May 2025 11:35:43 GMT</pubDate>
    <dc:creator>DonatellaMarino1</dc:creator>
    <dc:date>2025-05-20T11:35:43Z</dc:date>
    <item>
      <title>Model Builder: how to use a Script output as an input for a Toolbar</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-how-to-use-a-script-output-as-an/m-p/1616005#M95863</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;I &lt;/SPAN&gt;&lt;SPAN class=""&gt;now &lt;/SPAN&gt;&lt;SPAN class=""&gt;have &lt;/SPAN&gt;&lt;SPAN class=""&gt;a &lt;/SPAN&gt;&lt;SPAN class=""&gt;script &lt;/SPAN&gt;&lt;SPAN class=""&gt;that &lt;/SPAN&gt;&lt;SPAN class=""&gt;extends &lt;/SPAN&gt;&lt;SPAN class=""&gt;a L&lt;/SPAN&gt;&lt;SPAN class=""&gt;ine &lt;/SPAN&gt;&lt;SPAN class=""&gt;to &lt;/SPAN&gt;&lt;SPAN class=""&gt;the &lt;/SPAN&gt;&lt;SPAN class=""&gt;edge &lt;/SPAN&gt;&lt;SPAN class=""&gt;of &lt;/SPAN&gt;&lt;SPAN class=""&gt;a P&lt;/SPAN&gt;&lt;SPAN class=""&gt;olygon (&lt;/SPAN&gt;&lt;SPAN class=""&gt;see &lt;/SPAN&gt;&lt;SPAN class=""&gt;my &lt;/SPAN&gt;&lt;SPAN class=""&gt;previous &lt;/SPAN&gt;&lt;SPAN class=""&gt;post), &lt;/SPAN&gt;&lt;SPAN class=""&gt;and &lt;/SPAN&gt;&lt;SPAN class=""&gt;I &lt;/SPAN&gt;&lt;SPAN class=""&gt;would &lt;/SPAN&gt;&lt;SPAN class=""&gt;like &lt;/SPAN&gt;&lt;SPAN class=""&gt;to &lt;/SPAN&gt;&lt;SPAN class=""&gt;use &lt;/SPAN&gt;&lt;SPAN class=""&gt;this &lt;/SPAN&gt;&lt;SPAN class=""&gt;extended L&lt;/SPAN&gt;&lt;SPAN class=""&gt;ine &lt;/SPAN&gt;&lt;SPAN class=""&gt;as &lt;/SPAN&gt;&lt;SPAN class=""&gt;input &lt;/SPAN&gt;&lt;SPAN class=""&gt;for &lt;/SPAN&gt;&lt;SPAN class=""&gt;another T&lt;/SPAN&gt;&lt;SPAN class=""&gt;oolbar — &lt;/SPAN&gt;&lt;SPAN class=""&gt;specifically, &lt;/SPAN&gt;&lt;SPAN class=""&gt;in "&lt;/SPAN&gt;&lt;SPAN class=""&gt;Create &lt;/SPAN&gt;&lt;SPAN class=""&gt;a &lt;/SPAN&gt;&lt;SPAN class=""&gt;TIN" &lt;/SPAN&gt;&lt;SPAN class=""&gt;as &lt;/SPAN&gt;&lt;SPAN class=""&gt;a "&lt;/SPAN&gt;&lt;SPAN class=""&gt;Soft &lt;/SPAN&gt;&lt;SPAN class=""&gt;Line." &lt;/SPAN&gt;&lt;SPAN class=""&gt;Does &lt;/SPAN&gt;&lt;SPAN class=""&gt;anyone &lt;/SPAN&gt;&lt;SPAN class=""&gt;know &lt;/SPAN&gt;&lt;SPAN class=""&gt;how &lt;/SPAN&gt;&lt;SPAN class=""&gt;I &lt;/SPAN&gt;&lt;SPAN class=""&gt;can &lt;/SPAN&gt;&lt;SPAN class=""&gt;do &lt;/SPAN&gt;&lt;SPAN class=""&gt;this?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="DonatellaMarino1_0-1747662591276.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/132499iB924642600B1B444/image-size/medium?v=v2&amp;amp;px=400" role="button" title="DonatellaMarino1_0-1747662591276.png" alt="DonatellaMarino1_0-1747662591276.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Hier what I'm missing: since I can't connect two Processes, I don't know how I can proceed.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hier there is my Script:&lt;BR /&gt;import arcpy&lt;BR /&gt;import math&lt;BR /&gt;&lt;BR /&gt;dist = 500&amp;nbsp;&lt;BR /&gt;fc_line = arcpy.GetParameterAsText(0)&amp;nbsp;&lt;BR /&gt;fc_poly = arcpy.GetParameterAsText(1)&amp;nbsp;&lt;BR /&gt;output_fc = arcpy.GetParameterAsText(2)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;temp_fc = "in_memory/temp_fc"&lt;BR /&gt;arcpy.CopyFeatures_management(fc_line, temp_fc)&lt;BR /&gt;with arcpy.da.SearchCursor(fc_poly, "SHAPE@") as scur:&lt;BR /&gt;for poly, in scur:&lt;BR /&gt;boundary = poly.boundary()&lt;BR /&gt;arcpy.SelectLayerByLocation_management(temp_fc, "WITHIN", poly)&lt;BR /&gt;with arcpy.da.UpdateCursor(temp_fc, "SHAPE@") as ucur:&lt;BR /&gt;for line, in ucur:&lt;BR /&gt;arr, = line.getPart()&lt;BR /&gt;SR = line.spatialReference # Räumliche Referenz der Linie&lt;BR /&gt;p1, p2 = arr[:2]&amp;nbsp;&lt;BR /&gt;angle = math.atan2(p2.Y - p1.Y, p2.X - p1.X)&amp;nbsp;&lt;BR /&gt;p = arcpy.Point(p1.X - dist * math.cos(angle), p1.Y - dist * math.sin(angle))&amp;nbsp;&lt;BR /&gt;arr.insert(0, p)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;pn1, pn = arr[-2:]&amp;nbsp;&lt;BR /&gt;angle = math.atan2(pn.Y - pn1.Y, pn.X - pn1.X)&amp;nbsp;&lt;BR /&gt;p = arcpy.Point(pn.X + dist * math.cos(angle), pn.Y + dist * math.sin(angle))&amp;nbsp;&lt;BR /&gt;arr.append(p)&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;line = arcpy.Polyline(arr, SR)&amp;nbsp;&lt;BR /&gt;line = line.cut(boundary)[1]&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;ucur.updateRow([line])&lt;BR /&gt;&lt;BR /&gt;arcpy.CopyFeatures_management(temp_fc, output_fc)&lt;BR /&gt;arcpy.Delete_management(temp_fc)&lt;BR /&gt;arcpy.SetParameterAsText(2, output_fc)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for any Tipps,&lt;/P&gt;&lt;P&gt;Donatella&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 11:35:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-how-to-use-a-script-output-as-an/m-p/1616005#M95863</guid>
      <dc:creator>DonatellaMarino1</dc:creator>
      <dc:date>2025-05-20T11:35:43Z</dc:date>
    </item>
    <item>
      <title>Re: Model Builder: how to use a Script output as an input for a Toolbar</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/model-builder-how-to-use-a-script-output-as-an/m-p/1616700#M95917</link>
      <description>&lt;P&gt;You need to define the outputfc result layer as an output parameter of your tool.&lt;/P&gt;&lt;P&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/inputs-and-outputs.htm" target="_blank" rel="noopener"&gt;https://pro.arcgis.com/en/pro-app/latest/help/sharing/overview/inputs-and-outputs.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Once that is done, when you add the tool to ModelBuilder, the tool will show an output oval that you can connect as input to other processes.&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://learn.arcgis.com/en/projects/create-a-python-script-tool/#make-a-tool-and-add-parameters:~:text=Next%2C%20you%20will-,configure%20the%20parameter%20for%20the%20output,-geodatabase" target="_blank" rel="noopener"&gt;https://learn.arcgis.com/en/projects/create-a-python-script-tool/#make-a-tool-and-add-parameters:~:text=Next%2C%20you%20will-,configure%20the%20parameter%20for%20the%20output,-geodatabase&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://support.esri.com/en-us/knowledge-base/how-to-add-output-parameter-in-a-model-builder-for-a-sc-000013730" target="_blank"&gt;https://support.esri.com/en-us/knowledge-base/how-to-add-output-parameter-in-a-model-builder-for-a-sc-000013730&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 May 2025 21:01:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/model-builder-how-to-use-a-script-output-as-an/m-p/1616700#M95917</guid>
      <dc:creator>BobBooth1</dc:creator>
      <dc:date>2025-05-20T21:01:59Z</dc:date>
    </item>
  </channel>
</rss>

