<?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: Dynamic Text - Removing Leading Drive Letter? in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666852#M29595</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pete, here is a link to the Python help regarding script tools (step 4) -&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-script-tools.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-script-tools.htm"&gt;What is a script tool?—Geoprocessing and Python | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 24 Jul 2020 17:02:52 GMT</pubDate>
    <dc:creator>TomBole</dc:creator>
    <dc:date>2020-07-24T17:02:52Z</dc:date>
    <item>
      <title>Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666846#M29589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&amp;nbsp; Is there a possible way to alter the&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;&amp;lt;dyn type="project" property="path"/&amp;gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;&lt;/EM&gt;to somehow remove the first 2 characters it displays?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; When I use&amp;nbsp;&lt;STRONG&gt;Path&lt;/STRONG&gt; for Dynamic Text it displays it as an example as:&lt;/P&gt;&lt;P&gt;&lt;EM&gt;T:\TestDrive\Project\Maplocation&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; What I want is the path to not show the "T:" and only display&amp;nbsp;&lt;EM&gt;\TestDrive\Project\Maplocation&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&amp;nbsp;&amp;nbsp;&lt;/EM&gt;Is that possible at all?&amp;nbsp; In our organization we have different drives by user so the Drive Letter can get confusing depending on how people have it mapped.&amp;nbsp; We have a more standard naming convention we use that I can add in before the&amp;nbsp;&lt;STRONG&gt;Path&lt;/STRONG&gt; which I would use instead of having the drive letter...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Jul 2020 19:58:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666846#M29589</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2020-07-23T19:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666847#M29590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Pete,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is nothing "out-of-the-box" that I'm aware of that you can use to parse dynamic text.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I believe you can use ArcPy.mp to do this. I'm in no way an expert in Python, but hopefully the following can at least get you started.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1. Get the path from the project&lt;BR /&gt;See:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/arcgisproject-class.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/mapping/arcgisproject-class.htm"&gt;ArcGISProject—ArcPy | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;2. Parse the string&lt;/P&gt;&lt;P&gt;See:&amp;nbsp;&lt;A class="link-titled" href="https://stackoverflow.com/questions/3167154/how-to-split-a-dos-path-into-its-components-in-python" title="https://stackoverflow.com/questions/3167154/how-to-split-a-dos-path-into-its-components-in-python"&gt;How to split a dos path into its components in Python - Stack Overflow&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;3. Pass it into a text element on the layout&lt;BR /&gt;See:&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/mapping/textelement-class.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/mapping/textelement-class.htm"&gt;TextElement—ArcPy | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;4. Create GP script with this code to be reused with other documents since this script would need to be run for each individual document and anytime the documents was moved to a different file location.&lt;BR /&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's a link to a series of ArcPy samples for both ArcMap (arcpy.mapping) and ArcGIS Pro (arcpy.mp) that may is a good resource -&amp;nbsp;&lt;A href="https://www.arcgis.com/home/group.html?sortField=modified&amp;amp;sortOrder=desc&amp;amp;id=398a345905c845e38229c15f5353d4e9&amp;amp;view=list#content"&gt;https://www.arcgis.com/home/group.html?sortField=modified&amp;amp;sortOrder=desc&amp;amp;id=398a345905c845e38229c15f5353d4e9&amp;amp;view=list#content&lt;/A&gt;&lt;SPAN style="font-size: 11.0pt;"&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope this helps,&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 14:55:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666847#M29590</guid>
      <dc:creator>TomBole</dc:creator>
      <dc:date>2020-07-24T14:55:33Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666848#M29591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here's a sample of how the code might look:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV&gt;p = arcpy.mp.ArcGISProject('current')&lt;BR /&gt; lyt = p.listLayouts('Layout')[0]&lt;BR /&gt; txt = lyt.listElements('TEXT_ELEMENT','Text')[0]&lt;BR /&gt; txt.text = p.filePath.split(':')[1]&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:17:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666848#M29591</guid>
      <dc:creator>TomBole</dc:creator>
      <dc:date>2020-07-24T15:17:06Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666849#M29592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Tom,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; I think maybe that is the only way to do something like this then.&amp;nbsp; Like you, I haven't done a lot in Python at all and I was hoping I could just do something within the text box itself, but maybe as you stated it might have to be done externally instead and then added into the Text Box somehow.&amp;nbsp; I'll have to take a look at the links and such then and see if I can get that to work.&amp;nbsp; Thanks...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:22:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666849#M29592</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2020-07-24T15:22:53Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666850#M29593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Even if the samples don't do exactly what you want they do provide good insight on how you can use Python.&lt;/P&gt;&lt;P&gt;Good luck, Pete.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 15:49:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666850#M29593</guid>
      <dc:creator>TomBole</dc:creator>
      <dc:date>2020-07-24T15:49:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666851#M29594</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, it's going to take some work to go through your suggestion on how to do this.&amp;nbsp; I just wish it would have been easier to just strip off text in the actual text box, or even alter what the &lt;STRONG&gt;PATH&lt;/STRONG&gt; function shows a bit easier.&amp;nbsp; Decades ago, I used old BASH commands to do this which was kind of easy...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 16:26:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666851#M29594</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2020-07-24T16:26:11Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666852#M29595</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Pete, here is a link to the Python help regarding script tools (step 4) -&amp;nbsp;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-script-tools.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/geoprocessing_and_python/a-quick-tour-of-creating-script-tools.htm"&gt;What is a script tool?—Geoprocessing and Python | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 17:02:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666852#M29595</guid>
      <dc:creator>TomBole</dc:creator>
      <dc:date>2020-07-24T17:02:52Z</dc:date>
    </item>
    <item>
      <title>Re: Dynamic Text - Removing Leading Drive Letter?</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666853#M29596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I've actually taken the ArcPy course for Pro, it's just that I haven't had a chance yet to start using it yet.&amp;nbsp; I have made some scripts in the past, nothing big, but I'll try and figure this situation out...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 Jul 2020 17:08:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/dynamic-text-removing-leading-drive-letter/m-p/666853#M29596</guid>
      <dc:creator>PeteJordan</dc:creator>
      <dc:date>2020-07-24T17:08:10Z</dc:date>
    </item>
  </channel>
</rss>

