<?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 REQUEST object width and height in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150690#M13704</link>
    <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Sorry if this has already been asked previously but I did look and couldn't find an answer.&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to draw a box/frame (POLY2_B) around text based object. I can do a bad job using this sort of script:&lt;BR /&gt;
&lt;BR /&gt;
!!!Request text height of style and name it&lt;BR /&gt;
x=REQUEST('Height_of_Style','arialbold_2',arialbold_h)&lt;BR /&gt;
&lt;BR /&gt;
!!!Specify the width and height of text&lt;BR /&gt;
txt_w=STW(txt_areas) / 1000 * GLOB_SCALE&lt;BR /&gt;
txt_h=arialbold_h / 1000 * GLOB_SCALE&lt;BR /&gt;
&lt;BR /&gt;
It's not quite working for me because the width of my box is dictated by width of the text string, which is not always the longest piece of text.&lt;BR /&gt;
&lt;BR /&gt;
I want to REQUEST the width and height (x and y) of my object and base the polyline/frame around it. Any advice???&lt;BR /&gt;
&lt;BR /&gt;
Jakub&lt;/T&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 28 May 2013 03:12:39 GMT</pubDate>
    <dc:creator>jakubc7</dc:creator>
    <dc:date>2013-05-28T03:12:39Z</dc:date>
    <item>
      <title>REQUEST object width and height</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150690#M13704</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Sorry if this has already been asked previously but I did look and couldn't find an answer.&lt;BR /&gt;
&lt;BR /&gt;
I'm trying to draw a box/frame (POLY2_B) around text based object. I can do a bad job using this sort of script:&lt;BR /&gt;
&lt;BR /&gt;
!!!Request text height of style and name it&lt;BR /&gt;
x=REQUEST('Height_of_Style','arialbold_2',arialbold_h)&lt;BR /&gt;
&lt;BR /&gt;
!!!Specify the width and height of text&lt;BR /&gt;
txt_w=STW(txt_areas) / 1000 * GLOB_SCALE&lt;BR /&gt;
txt_h=arialbold_h / 1000 * GLOB_SCALE&lt;BR /&gt;
&lt;BR /&gt;
It's not quite working for me because the width of my box is dictated by width of the text string, which is not always the longest piece of text.&lt;BR /&gt;
&lt;BR /&gt;
I want to REQUEST the width and height (x and y) of my object and base the polyline/frame around it. Any advice???&lt;BR /&gt;
&lt;BR /&gt;
Jakub&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 28 May 2013 03:12:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150690#M13704</guid>
      <dc:creator>jakubc7</dc:creator>
      <dc:date>2013-05-28T03:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: REQUEST object width and height</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150691#M13705</link>
      <description>Sounds like you are on the right track.&lt;BR /&gt;
You just need to determine the length of the longest text string (as you have done for "txt_areas" already.&lt;BR /&gt;
If you have more than one text string then find out what the length of each string is and then determine which one is longer.&lt;BR /&gt;
You could use ... box_wid = MAX (txt_w_1, txt_w_2, ... txt_w_n) ... to do this, where "txt_w_1" etc. are the widths of each of your text strings.&lt;BR /&gt;
&lt;BR /&gt;
It won't matter what text values are typed in for each of your text parameters by the user as this will determine which is the longest.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
You can also set a minimum known length so you box can never be less than a certain size.&lt;BR /&gt;
i.e. MAX (3.25, txt_w_1, txt_w_2, ... txt_w_n)&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Tue, 28 May 2013 03:52:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150691#M13705</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2013-05-28T03:52:17Z</dc:date>
    </item>
    <item>
      <title>Re: REQUEST object width and height</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150692#M13706</link>
      <description>Thanks for the reply Barry. That worked perfectly.</description>
      <pubDate>Wed, 29 May 2013 07:12:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/REQUEST-object-width-and-height/m-p/150692#M13706</guid>
      <dc:creator>jakubc7</dc:creator>
      <dc:date>2013-05-29T07:12:41Z</dc:date>
    </item>
  </channel>
</rss>

