<?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 convert inches to a whole number in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/convert-inches-to-a-whole-number/m-p/277426#M3045</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi All,&lt;BR /&gt;
I know this is a very basic GDL question but I can not find it in all of my searches.&lt;BR /&gt;
&lt;BR /&gt;
I have a dimension in an object that is in feet/inches, I would like to convert this to a text (without the ") &lt;BR /&gt;
Example:&lt;BR /&gt;
(Length) A = 0'-6"&lt;BR /&gt;
Convert to  (abc value)    6&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sounds easy enough but I cant figure it out.&lt;BR /&gt;
This is what I tried... &lt;BR /&gt;
PARAMETERS Width = STR ("%fi", A)&lt;BR /&gt;
This will give me a value of 6" NOT 6&lt;BR /&gt;
&lt;BR /&gt;
any input wold be great! &lt;BR /&gt;
Thanks again&lt;/T&gt;&lt;/DIV&gt;</description>
    <pubDate>Mon, 21 Jan 2019 14:40:37 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-01-21T14:40:37Z</dc:date>
    <item>
      <title>convert inches to a whole number</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/convert-inches-to-a-whole-number/m-p/277426#M3045</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi All,&lt;BR /&gt;
I know this is a very basic GDL question but I can not find it in all of my searches.&lt;BR /&gt;
&lt;BR /&gt;
I have a dimension in an object that is in feet/inches, I would like to convert this to a text (without the ") &lt;BR /&gt;
Example:&lt;BR /&gt;
(Length) A = 0'-6"&lt;BR /&gt;
Convert to  (abc value)    6&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Sounds easy enough but I cant figure it out.&lt;BR /&gt;
This is what I tried... &lt;BR /&gt;
PARAMETERS Width = STR ("%fi", A)&lt;BR /&gt;
This will give me a value of 6" NOT 6&lt;BR /&gt;
&lt;BR /&gt;
any input wold be great! &lt;BR /&gt;
Thanks again&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 21 Jan 2019 14:40:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/convert-inches-to-a-whole-number/m-p/277426#M3045</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-01-21T14:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: convert inches to a whole number</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/convert-inches-to-a-whole-number/m-p/277427#M3046</link>
      <description>It depends on what you want to achieve. As I know ArchiCAD is using meters inside if the system. So every time when you are using feet and inches - it converts them into meters.&lt;BR /&gt;
If you want to convert your A into feet and inches and show only inches without " symbol as a string, then first question - what would you like to get, if A has feet too - let say it's 1'-6"? Will %fi - fractional inches - not show feet? Also, if it's fractional inches - what will happen when you have let say 1/6"?&lt;BR /&gt;
All these questions necessary to ask that script wouldn't collapse when A is changing.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;Width = STR ("%fi", A) &lt;/PRE&gt;

&lt;BR /&gt;
will give you 6" - as a string. You can use SPLIT to separate 6 from " &lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;n=SPLIT(Width, '%n"', widthNum, string)
widthNum will be equal 6 (number)&lt;/PRE&gt;

&lt;BR /&gt;
but if it will be 1/6" then maybe better to cut " from the end:&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;len = STRLEN(Width)
WidthNum  = STRSUB(Width, 1, len-1)&lt;/PRE&gt;

&lt;BR /&gt;
So, first, we are getting the length of the word (1/6") - i.e. 4 symbols.&lt;BR /&gt;
Then we are showing from the first symbol until len-1 symbol (i.e. 3).&lt;BR /&gt;
&lt;BR /&gt;
WidthNum = '1/6' (string)</description>
      <pubDate>Mon, 24 May 2021 22:57:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/convert-inches-to-a-whole-number/m-p/277427#M3046</guid>
      <dc:creator>Podolsky</dc:creator>
      <dc:date>2021-05-24T22:57:11Z</dc:date>
    </item>
  </channel>
</rss>

