wjmdes Posted May 2, 2016 Share Posted May 2, 2016 The polyline labels are great, however any idea to get rid of the many decimal points? Link to comment Share on other sites More sharing options...
Alaskan_Son Posted May 2, 2016 Share Posted May 2, 2016 See this thread, specifically post number three… https://chieftalk.chiefarchitect.com/index.php?/topic/9103-poly-line-labels-why-did-chief-bother-to-add-this-feature/?hl=%2Bdecimal+%2Bplaces Link to comment Share on other sites More sharing options...
wjmdes Posted May 2, 2016 Author Share Posted May 2, 2016 Thank you, now I need to Figure out how to make it in acres... Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 2, 2016 Share Posted May 2, 2016 referenced ? obj=referenced : obj=owner obj.area/43560.round(3) Link to comment Share on other sites More sharing options...
wjmdes Posted May 2, 2016 Author Share Posted May 2, 2016 hmmm, getting 15 decimal places.... Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 2, 2016 Share Posted May 2, 2016 Sorry, try this: referenced ? obj=referenced : obj=owner (obj.area/43560).round(3) Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 2, 2016 Share Posted May 2, 2016 I think Joe means: (obj.area/43560).round(3) Thanks Gerry, You beat me to it by about 5 seconds. Link to comment Share on other sites More sharing options...
wjmdes Posted May 2, 2016 Author Share Posted May 2, 2016 That worked, thank you.... Is it possible to center text in a label? Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 2, 2016 Share Posted May 2, 2016 Labels are not "Rich Text" so generally the answer is no. However, there is a .center(n) method for text strings in Ruby. For that macro we would have to first change the value from numeric to string using .to_s and add the " acres" and then center it. Here's the revised macro: referenced ? obj=referenced : obj=owner ((obj.area/43560).round(3).to_s + " acres").center(20) Link to comment Share on other sites More sharing options...
SNestor Posted May 3, 2016 Share Posted May 3, 2016 My question is...how can I learn to use Ruby myself? Joe...is there a book you would recommend? Does Chief offer any good info related to Ruby that I just don't know about? Link to comment Share on other sites More sharing options...
Joe_Carrick Posted May 3, 2016 Share Posted May 3, 2016 Steve, Google Ruby for a variety of information. I personally just use http://ruby-doc.org/core-2.2.2 There is the "Little Book of Ruby" which is pretty basic. Start with this and Chief's Ruby "Tutorial". Then migrate to the above link which has the complete documentation. Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now