<?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 Text Expression substitution with Python in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341643#M26787</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a text expression for a new custom dimension style that will label as follows from a CustomLength value and a user input as a part of the expression.&amp;nbsp; For example, "Bore Drill #&amp;lt;user input&amp;gt; ([CustomLength]')", or "Bore Drill #1 (200')" as the string.&amp;nbsp; My main problem is figuring out the python code to allow user input of the Drill # value and plug it into the rest of the string.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 04 Mar 2015 17:30:15 GMT</pubDate>
    <dc:creator>MikeSullivan</dc:creator>
    <dc:date>2015-03-04T17:30:15Z</dc:date>
    <item>
      <title>Text Expression substitution with Python</title>
      <link>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341643#M26787</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am trying to create a text expression for a new custom dimension style that will label as follows from a CustomLength value and a user input as a part of the expression.&amp;nbsp; For example, "Bore Drill #&amp;lt;user input&amp;gt; ([CustomLength]')", or "Bore Drill #1 (200')" as the string.&amp;nbsp; My main problem is figuring out the python code to allow user input of the Drill # value and plug it into the rest of the string.&amp;nbsp; Any ideas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 17:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341643#M26787</guid>
      <dc:creator>MikeSullivan</dc:creator>
      <dc:date>2015-03-04T17:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: Text Expression substitution with Python</title>
      <link>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341644#M26788</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;If you're running inside ArcGIS as a script tool, you would generally collect user input with arcpy.&lt;A href="http://resources.arcgis.com/en/help/main/10.1/index.html#//018v00000047000000" rel="nofollow noopener noreferrer" target="_blank"&gt;GetParameterAsText()&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myParameter1 = arcpy.GetParameterAsText(0)
myParameter2 = arcpy.GetParameterAsText(1)&lt;/PRE&gt;&lt;P&gt;^ values are now in python variables myParameter1 and myParameter2.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If you're creating a standalone script, you can also use the built-in raw_input() function.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;myParameter1 = raw_input('Blahblah:&amp;nbsp; ')&lt;/PRE&gt;&lt;P&gt;^ pops up input box and collects entered text.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 16:07:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341644#M26788</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2021-12-11T16:07:59Z</dc:date>
    </item>
    <item>
      <title>Re: Text Expression substitution with Python</title>
      <link>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341645#M26789</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I guess I should mention, that the text expression I'm trying to build is sort of like a calculation script.&amp;nbsp; I'm not a programmer and don't know about script tools, but I thought I could just do this is python script through the expression Advanced mode.&amp;nbsp; I'm not sure if this is making sense, so I've attached a screen capture of the interface I'm using in creating the dimension style text properties and expression that is failing.&amp;nbsp; As mentioned, I'm not that good at writing code, but I thought this logic would work.&amp;nbsp; Please help!&amp;nbsp; Any suggestions are appreciated.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="DimensionTextExpressionError.JPG" class="image-1 jive-image" src="https://community.esri.com/legacyfs/online/68430_DimensionTextExpressionError.JPG" style="width: 620px; height: 464px;" /&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Mike&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 21:45:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341645#M26789</guid>
      <dc:creator>MikeSullivan</dc:creator>
      <dc:date>2015-03-04T21:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Text Expression substitution with Python</title>
      <link>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341646#M26790</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Oh, I completely misunderstood how you wanted to use user input. I'm going to say that it's not possible the way you've got it. I'm actually still not quite sure what you're trying to achieve - for each bore drill location, the user needs to type in the number? That could be a lot of typing...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 23:41:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341646#M26790</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2015-03-04T23:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: Text Expression substitution with Python</title>
      <link>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341647#M26791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It's related to dimension text.&amp;nbsp; Setting the text to be labeled from an advanced expression on the dimension style.&amp;nbsp; I didn't think this was possible.&amp;nbsp; Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Mar 2015 23:44:25 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/text-expression-substitution-with-python/m-p/341647#M26791</guid>
      <dc:creator>MikeSullivan</dc:creator>
      <dc:date>2015-03-04T23:44:25Z</dc:date>
    </item>
  </channel>
</rss>

