<?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: how do i create a single text string from three paramete in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58310#M32116</link>
    <description>Hello John,&lt;BR /&gt;
Right you are. I had forgotten that after converting&lt;BR /&gt;
the numbers to strings you can concatenate the strings&lt;BR /&gt;
with the plus sign.&lt;BR /&gt;
&lt;BR /&gt;
Hello LiHigh,&lt;BR /&gt;
Depending on the form Ben wants,&lt;BR /&gt;
the second form of the str() works as well.&lt;BR /&gt;
&lt;BR /&gt;
Peter Devlin</description>
    <pubDate>Fri, 29 Dec 2006 20:17:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-12-29T20:17:10Z</dc:date>
    <item>
      <title>how do i create a single text string from three parameters?</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58304#M32110</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;gdl knucklehead (me) looking for assistance:&lt;BR /&gt;
&lt;BR /&gt;
i'm trying to create a single text string made from the values of multiple parameters....&lt;BR /&gt;
&lt;BR /&gt;
the background: i'm modifying the steel section objects to display their profile sizes adjacent to the placed section. when this is a standard profile designation i can use use the 'Profile' parameter value in a TEXT2 command, so:&lt;BR /&gt;
&lt;BR /&gt;
TEXT2 0, 0, Profile&lt;BR /&gt;
&lt;BR /&gt;
the problem: when the section size is set to 'CUSTOM' i would like the TEXT2 command to display the custom section size. this involves creating a string (i think) to combine the three size parameters, each separated by an "x" character:&lt;BR /&gt;
&lt;BR /&gt;
ws = width of section&lt;BR /&gt;
ds = depth of section&lt;BR /&gt;
massm = weight/meter&lt;BR /&gt;
&lt;BR /&gt;
i need the string to read 'ds x ws x massm' . . . e.g. "406x178x60"&lt;BR /&gt;
&lt;BR /&gt;
i've tried various separators and quotation marks, but keep getting errors.&lt;BR /&gt;
&lt;BR /&gt;
additionally, i'd really like the 'massm' value to be rounded up to a whole number . . . i get the impression from the GDL manual that this can be done, but i just don't understand a bloody word of it . . .  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_redface.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
thanks in advance!&lt;BR /&gt;
~/archiben&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Dec 2006 00:46:27 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58304#M32110</guid>
      <dc:creator>__archiben</dc:creator>
      <dc:date>2006-12-29T00:46:27Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58305#M32111</link>
      <description>Hello Ben,&lt;BR /&gt;
I do not know of a way to make a single TEXT2 statement&lt;BR /&gt;
containing five strings spaced out so it is readable.&lt;BR /&gt;
You can do what you want using separate TEXT2 statements.&lt;BR /&gt;
The following code with, I hope, understandable comments&lt;BR /&gt;
(the text preceded by exclamation points) may help.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
DEFINE STYLE "mystyle"  "helvetica", 12,1,0&lt;BR /&gt;
&lt;BR /&gt;
SET STYLE "mystyle"&lt;BR /&gt;
&lt;BR /&gt;
!!!ws=ws*3.28084*12		!!conversion to imperial to test script&lt;BR /&gt;
!!!ds=ds*3.28084*12	         !!conversion to imperial to test script&lt;BR /&gt;
&lt;BR /&gt;
massm=CEIL(massm)             !!the CEIL() function rounds up &lt;BR /&gt;
                                            !!any decimal number&lt;BR /&gt;
                                            !!to the nearest whole number&lt;BR /&gt;
&lt;BR /&gt;
!!NOTE: str() is a function that converts a number to a string&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
wx="x"	                               !!defines the string "x"&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
wid=stw(wx)/1000*A_	              !!wid=width of the string "x"&lt;BR /&gt;
wid1=stw(str(ws,3,2))/1000*A_     !!wid1=width of the the number ws   &lt;BR /&gt;
                                                      !! converted to a string&lt;BR /&gt;
wid2=stw(str(ds,3,2))/1000*A_     !!wid1=width of the the number ds converted to a string&lt;BR /&gt;
&lt;BR /&gt;
text2 0,0,str(ws,3,2)&lt;BR /&gt;
text2 wid1,0,"x"&lt;BR /&gt;
text2 wid1+wid,0,str(ds,3,2)&lt;BR /&gt;
text2 wid1+wid+wid2,0,"x"&lt;BR /&gt;
text2 wid1+wid+wid2+wid,0,str(massm,3,2)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Peter Devlin</description>
      <pubDate>Fri, 29 Dec 2006 03:23:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58305#M32111</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-12-29T03:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58306#M32112</link>
      <description>&lt;BLOCKQUOTE&gt;Peter wrote:&lt;BR /&gt;I do not know of a way to make a single TEXT2 statement containing five strings spaced out so it is readable. You can do what you want using separate TEXT2 statements. The following code with, I hope, understandable comments (the text preceded by exclamation points) may help.&lt;/BLOCKQUOTE&gt;
thanks peter&lt;BR /&gt;
&lt;BR /&gt;
wow! i had in the back of my mind that this could be done by finding the string lengths and multiple text blocks, but i figured that there &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;must&lt;E&gt;&lt;/E&gt; be an easier way. such a lot of code for something so simple . . .&lt;BR /&gt;
&lt;BR /&gt;
i pretty much followed your comments. i'll give it a whirl tonight and hopefully get it working!&lt;BR /&gt;
&lt;BR /&gt;
thanks again!&lt;BR /&gt;
ben</description>
      <pubDate>Fri, 29 Dec 2006 04:56:14 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58306#M32112</guid>
      <dc:creator>__archiben</dc:creator>
      <dc:date>2006-12-29T04:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58307#M32113</link>
      <description>Hello Ben,&lt;BR /&gt;
Yes, complicated for such a simple thing.&lt;BR /&gt;
There may be a simpler way using TEXTBLOCK2 but&lt;BR /&gt;
I have not studied this new command.&lt;BR /&gt;
&lt;BR /&gt;
Let us know how it goes.&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Peter Devlin</description>
      <pubDate>Fri, 29 Dec 2006 05:10:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58307#M32113</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-12-29T05:10:05Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58308#M32114</link>
      <description>Just use the + sign to concatenate the strings. Then you dont need all of the width calculations.&lt;BR /&gt;
&lt;BR /&gt;
aa=str(ws,3,2) &lt;BR /&gt;
bb=str(ds,3,2) &lt;BR /&gt;
cc=str(massm,3,2)&lt;BR /&gt;
text2 0,0, aa+"x"+bb+"x"+cc</description>
      <pubDate>Fri, 29 Dec 2006 05:45:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58308#M32114</guid>
      <dc:creator>Aussie John</dc:creator>
      <dc:date>2006-12-29T05:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58309#M32115</link>
      <description>And to take care of the rounding &amp;amp; conv spec:&lt;BR /&gt;
&lt;BR /&gt;
aa = STR("%.0mm",ws)  !! whole no. in mm&lt;BR /&gt;
bb = STR("%.0mm",ds)  !! whole no. in mm&lt;BR /&gt;
cc = STR("%.0",massm) !! whole no. &lt;BR /&gt;
&lt;BR /&gt;
TEXT2 0, 0,  aa + "x" + bb+ "x" + cc + "kg/m"</description>
      <pubDate>Fri, 29 Dec 2006 14:44:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58309#M32115</guid>
      <dc:creator>LiHigh</dc:creator>
      <dc:date>2006-12-29T14:44:11Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58310#M32116</link>
      <description>Hello John,&lt;BR /&gt;
Right you are. I had forgotten that after converting&lt;BR /&gt;
the numbers to strings you can concatenate the strings&lt;BR /&gt;
with the plus sign.&lt;BR /&gt;
&lt;BR /&gt;
Hello LiHigh,&lt;BR /&gt;
Depending on the form Ben wants,&lt;BR /&gt;
the second form of the str() works as well.&lt;BR /&gt;
&lt;BR /&gt;
Peter Devlin</description>
      <pubDate>Fri, 29 Dec 2006 20:17:10 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58310#M32116</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-12-29T20:17:10Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58311#M32117</link>
      <description>hi and thanks to you all.&lt;BR /&gt;
&lt;BR /&gt;
Peter - i got your solution working shortly before john posted, but ultimately his solution is cleaner.&lt;BR /&gt;
&lt;BR /&gt;
LiHigh - as you correctly guessed, i would need to control the rounding on these values. i was able to decipher the GDL manual based on your examples and have been able to work out all of the various rounding requirements i needed for all of the other steel sections, not just universal columns.&lt;BR /&gt;
&lt;BR /&gt;
the final (universal column) code:&lt;BR /&gt;

&lt;PRE&gt;if nz_label then
	add2 nz_labelPosX, nz_labelPosY
	rot2 nz_labelRotAng
	
	define style nz_labelFontStyle nz_labelFont, nz_labelFontSize, 4, nz_labelFontFaceCode
	set style nz_labelFontStyle
	pen nz_labelFontPen
	
	if Profile="CUSTOM" then
		stringDS=str("%.0mm",ds)
		stringWS=str("%.0mm",ws)
		stringMassm=str("%.0",massm)
		text2 0, 0, stringDS + "x" + stringWS + "UC " + stringMassm
	else
		text2 0, 0, Profile
	endif

	del 2
endif&lt;/PRE&gt;

the next step for me is to turn this into a label object (i actually loathe having textual information display with object itself as there is no control over the display of this text based on the drawing context) . . . but it will do for the next couple of weeks whilst i recharge my GDL batteries and consider how i'm going to tackle that one!  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_wink.gif" style="display : inline;" /&gt;  &lt;IMG src="https://community.graphisoft.com/legacyfs/online/emojis/icon_biggrin.gif" style="display : inline;" /&gt; &lt;BR /&gt;
&lt;BR /&gt;
thanks again!&lt;BR /&gt;
ben</description>
      <pubDate>Thu, 04 Jan 2007 00:48:23 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58311#M32117</guid>
      <dc:creator>__archiben</dc:creator>
      <dc:date>2007-01-04T00:48:23Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58312#M32118</link>
      <description>Hello Ben,&lt;BR /&gt;
I'm glad you got it working.&lt;BR /&gt;
Yes, Johns solution is cleaner. &lt;BR /&gt;
I'm sorry you didn't catch his&lt;BR /&gt;
post before you started working.&lt;BR /&gt;
Peter Devlin</description>
      <pubDate>Thu, 04 Jan 2007 02:33:34 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58312#M32118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-04T02:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: how do i create a single text string from three paramete</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58313#M32119</link>
      <description>Hello Ben,&lt;BR /&gt;
You said, "i actually loathe having &lt;BR /&gt;
textual information display with object itself &lt;BR /&gt;
as there is no control over the display of this text &lt;BR /&gt;
based on the drawing context".&lt;BR /&gt;
&lt;BR /&gt;
Could you say a little more about what you mean by this ?&lt;BR /&gt;
What "drawing context" are you referring to ?&lt;BR /&gt;
What sort of control of the display do you need ?&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Peter Devlin</description>
      <pubDate>Thu, 04 Jan 2007 03:21:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/how-do-i-create-a-single-text-string-from-three-parameters/m-p/58313#M32119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-01-04T03:21:18Z</dc:date>
    </item>
  </channel>
</rss>

