<?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: Referencing Text Anchor in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290182#M3993</link>
    <description>If it is a text block then you can request width and height after you have defined the textblock.&lt;BR /&gt;

&lt;PRE&gt;REQUEST ("TEXTBLOCK_INFO", textblock_name, width, height)&lt;/PRE&gt;

If it is just text then you can use STRLEN to get the length.&lt;BR /&gt;

&lt;PRE&gt;STRLEN (string_expression)&lt;/PRE&gt;

Barry.</description>
    <pubDate>Thu, 10 May 2018 07:15:33 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2018-05-10T07:15:33Z</dc:date>
    <item>
      <title>Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290181#M3992</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Is there a way to reference a text anchor?&lt;BR /&gt;
&lt;BR /&gt;
eg. I have variable length text anchored on point 7 and I want to put something defined by a (sub)routine after it based on where the text ended, anchor 9.&lt;BR /&gt;
&lt;BR /&gt;
eg2. I have a editable text box that I want to offset a square from.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 10 May 2018 06:44:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290181#M3992</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2018-05-10T06:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290182#M3993</link>
      <description>If it is a text block then you can request width and height after you have defined the textblock.&lt;BR /&gt;

&lt;PRE&gt;REQUEST ("TEXTBLOCK_INFO", textblock_name, width, height)&lt;/PRE&gt;

If it is just text then you can use STRLEN to get the length.&lt;BR /&gt;

&lt;PRE&gt;STRLEN (string_expression)&lt;/PRE&gt;

Barry.</description>
      <pubDate>Thu, 10 May 2018 07:15:33 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290182#M3993</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-05-10T07:15:33Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290183#M3994</link>
      <description>I seem to only be able to get a return of "2" from:&lt;BR /&gt;

 &lt;PRE&gt;TEXTBLOCK "papersize" 0, 7, 0, 1, 1, 0, "Hello"
x2 = REQUEST ("TEXTBLOCK_INFO", "papersize", width)&lt;/PRE&gt;

Regardless of the text defined by "papersize". Both width and height return "2".&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Fri, 11 May 2018 01:39:13 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290183#M3994</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2018-05-11T01:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290184#M3995</link>
      <description>The command is not for either width or height.&lt;BR /&gt;
You must request both at the same time.&lt;BR /&gt;
&lt;BR /&gt;
x2 = REQUEST ("TEXTBLOCK_INFO", "papersize", width, height)&lt;BR /&gt;
&lt;BR /&gt;
Does that make any difference?&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 11 May 2018 01:59:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290184#M3995</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-05-11T01:59:40Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290185#M3996</link>
      <description>I get "4" instead</description>
      <pubDate>Fri, 11 May 2018 02:01:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290185#M3996</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2018-05-11T02:01:54Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290186#M3997</link>
      <description>Ah - it is not the "X2" value that you want to use.&lt;BR /&gt;
The sizes are actually put in the height and width variables.&lt;BR /&gt;
So it is those that you need to use.&lt;BR /&gt;
&lt;BR /&gt;
You may need to convert to mm or m depending on how you set up your textblock.&lt;BR /&gt;



I use a fixed_height parameter of '1' in my textblock and I do this when I use height and width to convert them to a usable dimension to suit the current scale.&lt;BR /&gt;
&lt;BR /&gt;
height*(A_/1000)</description>
      <pubDate>Fri, 11 May 2018 02:20:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290186#M3997</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-05-11T02:20:00Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290187#M3998</link>
      <description>Ah. Was wondering how it worked since it returns multiple variables. All good now.&lt;BR /&gt;
&lt;BR /&gt;
 So why is there a need to use it as a definition? In this case, "x2" becomes a dead variable...</description>
      <pubDate>Fri, 11 May 2018 02:32:36 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290187#M3998</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2018-05-11T02:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: Referencing Text Anchor</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290188#M3999</link>
      <description>'X2' (or the 'return value') just contains a value to say if the request is successful or not.&lt;BR /&gt;
0 means not successful.&lt;BR /&gt;
It will return a number of successful results - depending on the request itself.&lt;BR /&gt;
Not sure why this gives 4 - I would have thought 2.&lt;BR /&gt;



I don't think it is explained well in the GDL guide that you need to use this return value when using a REQUEST command.&lt;BR /&gt;
Anyway it doesn't really matter as it is the actual requested values that you want.&lt;BR /&gt;
&lt;BR /&gt;
Quite often you will see ...&lt;BR /&gt;
Dummy=Request(.......)&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Fri, 11 May 2018 02:44:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Referencing-Text-Anchor/m-p/290188#M3999</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2018-05-11T02:44:04Z</dc:date>
    </item>
  </channel>
</rss>

