<?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: Labelling Depth points in ArcMap in ArcGIS Mapping and Charting Questions</title>
    <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652625#M2295</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: azzwan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello Aaron,&lt;BR /&gt;&lt;BR /&gt;Looks like you might need a conditional branch around the second statement:&lt;BR /&gt;&lt;BR /&gt;fltDepth = Round([Depth] * -1, 1)&lt;BR /&gt;&lt;BR /&gt;Where you check if [Depth] is greater than zero and only apply the multiplication factor of -1 if it is less than zero. As for your second question on how to apply underlining only to the positive drying heights, you could apply it only if the depths value is greater than zero in your conditional block.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sabeshan Srinivasan&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sabeshan, thanks for the reply.&amp;nbsp; I understand what you are saying but my lack of script writing knowledge prevents me from going any further.&amp;nbsp; Would you mind modifying the script that I submitted to show me how to do this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 23 Feb 2014 21:28:31 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2014-02-23T21:28:31Z</dc:date>
    <item>
      <title>Labelling Depth points in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652623#M2293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: azzwan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am not sure if this is the best forum to post this question but hopefully someone can point me in the right direction.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a thinned bathymetry points file where the depths are negative in sign and drying heights are positive.&amp;nbsp; I intend to create a map and label my points as depths as you would see them on a nautical chart.&amp;nbsp; For example the the negative depths become positive values and the depths are rounded to 1 decimal place etc.&amp;nbsp; I have a a small VB Script for doing just that and it works quite well.&amp;nbsp; However, I have a problem, the drying heights appear as negative numbers once labelled.&amp;nbsp; I would like to have the drying heights remain positive sign but become underlined labels.&amp;nbsp;&amp;nbsp; I do not know much about scripting so if anyone can help me out with a way to do this it would be greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;To enter the label script I go to layer properties&amp;gt;label&amp;gt;test string Expression&amp;gt;Under Expression I tick the advanced option and then paste in the VBScript.&amp;nbsp; I then click on Verify to make sure that it works and then OK.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example of the points file [ATTACH=CONFIG]31500[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is an example of how the points are labelled[ATTACH=CONFIG]31501[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here is the current VB Script that I am using:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Function FindLabel ( [Depth] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fltDepth = Round([Depth] * -1, 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; strChar = "."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intPos = InStr(1, fltDepth, strChar)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intLen1 = Len(fltDepth)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intLen2 = intLen1 - intPos&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If intPos &amp;lt;&amp;gt; 0 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; intStart = Left(fltDepth, intPos - 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; intLast = Right(fltDepth, intLen2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'strOutput = intStart &amp;amp; " " &amp;amp; intLast&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; FindLabel = intStart &amp;amp; "&amp;lt;SUB&amp;gt;" &amp;amp; intLast &amp;amp; "&amp;lt;/SUB&amp;gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; FindLabel = fltDepth&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; 'FindLabel = strOutput&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;End Function&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards, Aaron&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Feb 2014 02:17:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652623#M2293</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-17T02:17:57Z</dc:date>
    </item>
    <item>
      <title>Re: Labelling Depth points in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652624#M2294</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Aaron,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Looks like you might need a conditional branch around the second statement:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;fltDepth = Round([Depth] * -1, 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Where you check if [Depth] is greater than zero and only apply the multiplication factor of -1 if it is less than zero. As for your second question on how to apply underlining only to the positive drying heights, you could apply it only if the depths value is greater than zero in your conditional block.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sabeshan Srinivasan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 18 Feb 2014 19:09:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652624#M2294</guid>
      <dc:creator>SabeshanSrinivasan</dc:creator>
      <dc:date>2014-02-18T19:09:47Z</dc:date>
    </item>
    <item>
      <title>Re: Labelling Depth points in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652625#M2295</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: azzwan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hello Aaron,&lt;BR /&gt;&lt;BR /&gt;Looks like you might need a conditional branch around the second statement:&lt;BR /&gt;&lt;BR /&gt;fltDepth = Round([Depth] * -1, 1)&lt;BR /&gt;&lt;BR /&gt;Where you check if [Depth] is greater than zero and only apply the multiplication factor of -1 if it is less than zero. As for your second question on how to apply underlining only to the positive drying heights, you could apply it only if the depths value is greater than zero in your conditional block.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Sabeshan Srinivasan&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Sabeshan, thanks for the reply.&amp;nbsp; I understand what you are saying but my lack of script writing knowledge prevents me from going any further.&amp;nbsp; Would you mind modifying the script that I submitted to show me how to do this?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 23 Feb 2014 21:28:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652625#M2295</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-23T21:28:31Z</dc:date>
    </item>
    <item>
      <title>Re: Labelling Depth points in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652626#M2296</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Aaron, try this out:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;Function FindLabel ( [Depth] )
 If Round([Depth]) &amp;gt; 0 Then
&amp;nbsp; fltDepth = Round([Depth], 1)
 Else
&amp;nbsp; fltDepth = Round([Depth] * -1, 1)
 End If
 
 strChar = "."
&amp;nbsp; intPos = InStr(1, fltDepth, strChar)
 intLen1 = Len(fltDepth)
&amp;nbsp; intLen2 = intLen1 - intPos
&amp;nbsp; 
&amp;nbsp; If intPos &amp;lt;&amp;gt; 0 Then
&amp;nbsp;&amp;nbsp; intStart = Left(fltDepth, intPos - 1)
&amp;nbsp; intLast = Right(fltDepth, intLen2)
&amp;nbsp;&amp;nbsp; 'strOutput = intStart &amp;amp; " " &amp;amp; intLast
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp; FindLabel = intStart &amp;amp; "&amp;lt;SUB&amp;gt;" &amp;amp; intLast &amp;amp; "&amp;lt;/SUB&amp;gt;"
&amp;nbsp; Else
&amp;nbsp;&amp;nbsp; FindLabel = fltDepth
 End If
 
 If fltDepth &amp;gt; 0 Then
&amp;nbsp; FindLabel = "&amp;lt;UND&amp;gt;" &amp;amp; FindLabel &amp;amp; "&amp;lt;/UND&amp;gt;"
 End If
 
 'FindLabel = strOutput
End Function&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I basically added a conditional check in the beginning to only negate the value returned from [Depth] if it was less than 0. I also added logic at the end to apply an underline ("&amp;lt;UND&amp;gt;" tag) if the depth was positive. Hope this helps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;One word of caution - I didn't test the code changes as I directly wrote them here. The changes are simple enough and should work but don't be surprised if you see an error due to some simple mistake I may have made!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Sabeshan&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 03:40:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652626#M2296</guid>
      <dc:creator>SabeshanSrinivasan</dc:creator>
      <dc:date>2021-12-12T03:40:09Z</dc:date>
    </item>
    <item>
      <title>Re: Labelling Depth points in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652627#M2297</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Original User: azzwan&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi Sabeshan,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you for the modified script.&amp;nbsp; I have trialled it but I did not get the results that I expected.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This first screen capture shows the points labelled with your script unmodified.&amp;nbsp;&amp;nbsp; [ATTACH=CONFIG]31748[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Notice that all the depths are underlined &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I then modified the script by replacing the fltDepth = Round([Depth] * -1, 1) with fltDepth = Round([Depth] * 1, 1) and this is the result that I got&amp;nbsp; [ATTACH=CONFIG]31749[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Notice that the drying height in the top left is labelled correctly but all of the other depths have picked up the negative sign.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any more ideas.&amp;nbsp; Thanks again for your time.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Aaron Godwin&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 26 Feb 2014 03:05:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652627#M2297</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2014-02-26T03:05:22Z</dc:date>
    </item>
    <item>
      <title>Re: Labelling Depth points in ArcMap</title>
      <link>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652628#M2298</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Function FindLabel ( [Depth] )&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; If Round([Depth]) &amp;lt; 0 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fltDepth = Round([Depth] * -1, 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; fltDepth = Round([Depth] , 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; strChar = "."&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intPos = InStr(1, fltDepth, strChar)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intLen1 = Len(fltDepth)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intLen2 = intLen1 - intPos&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; If intPos &amp;lt;&amp;gt; 0 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intStart = Left(fltDepth, intPos - 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; intLast = Right(fltDepth, intLen2)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; 'strOutput = intStart &amp;amp; " " &amp;amp; intLast&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; FindLabel = intStart &amp;amp; "&amp;lt;SUB&amp;gt;" &amp;amp; intLast &amp;amp; "&amp;lt;/SUB&amp;gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; Else&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FindLabel = fltDepth&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; If fltDepth &amp;lt; 0 Then&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; FindLabel = "&amp;lt;UND&amp;gt;" &amp;amp; FindLabel &amp;amp; "&amp;lt;/UND&amp;gt;"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End If&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; 'FindLabel = strOutput&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; End Function&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 01 Mar 2014 07:44:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-mapping-and-charting-questions/labelling-depth-points-in-arcmap/m-p/652628#M2298</guid>
      <dc:creator>arlandeleon</dc:creator>
      <dc:date>2014-03-01T07:44:00Z</dc:date>
    </item>
  </channel>
</rss>

