<?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: Using global id as a start for numbering in object in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153196#M21913</link>
    <description>I figured it was the SPLIT function, I was just writing it incorrectly.  I originally failed to put '%n' in quotes.  After a quick check of the GDL Cookbook, I found my error. &lt;BR /&gt;
 &lt;BR /&gt;
The working code is: &lt;BR /&gt;
 &lt;BR /&gt;
if use_glob_id then &lt;BR /&gt;
	x=SPLIT(GLOB_ID,'%n',start_num) &lt;BR /&gt;
	PARAMETERS start_num=start_num &lt;BR /&gt;
endif</description>
    <pubDate>Tue, 08 Dec 2009 17:59:03 GMT</pubDate>
    <dc:creator>jshuether</dc:creator>
    <dc:date>2009-12-08T17:59:03Z</dc:date>
    <item>
      <title>Using global id as a start for numbering in object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153194#M21911</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I'm trying to create a object that will number itself in 2D, but the starting number is not always 1 (similar to Parking Place 10.gsm). &lt;BR /&gt;
&lt;BR /&gt;
for j=1 to n-1&lt;BR /&gt;
	add2 a/n,0&lt;BR /&gt;
	text2 0,0,j+start_num-1&lt;BR /&gt;
next j&lt;BR /&gt;
del j-1&lt;BR /&gt;
&lt;BR /&gt;
start_num is an integer variable.&lt;BR /&gt;
&lt;BR /&gt;
It works &lt;U&gt;&lt;/U&gt;&lt;S&gt;&lt;U&gt;&lt;U&gt;&lt;/U&gt;&lt;/U&gt;&lt;/S&gt;unless&lt;E&gt;&lt;/E&gt; I include the following code:&lt;BR /&gt;
&lt;BR /&gt;
if use_glob_id then&lt;BR /&gt;
	start_num = glob_id&lt;BR /&gt;
endif&lt;BR /&gt;
When including this code in the Master Script, despite whether use_glob_id = 1 or 0, I get the incompatible expression types error. What do I have to do to get the numerical number from the glob_id into my text to begin the numbering of my object?&lt;BR /&gt;
&lt;BR /&gt;
Side note: I've always wanted to be able to add select variables of an object to the Info Box to minimize the opening and closing of dialog boxes.&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Dec 2009 01:08:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153194#M21911</guid>
      <dc:creator>jshuether</dc:creator>
      <dc:date>2009-12-08T01:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using global id as a start for numbering in object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153195#M21912</link>
      <description>The GLOB_ID is a string rather than a number.&lt;BR /&gt;
So I would say you would have to use the SPLIT command to filter out the number component.&lt;BR /&gt;
However your GLOB_ID will always have to be in the same format - the user can type what ever they want in there.&lt;BR /&gt;
Type something other than what is expected in the ID and the script won't work again.&lt;BR /&gt;
&lt;BR /&gt;
I am guessing you would rather use the ID in the info box but you will be better off creating an parameter (integer) in the object that means only a number can be used.&lt;BR /&gt;
You can even control the range of numbers allowed to block out negatives or zero values.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Tue, 08 Dec 2009 02:32:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153195#M21912</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2009-12-08T02:32:02Z</dc:date>
    </item>
    <item>
      <title>Re: Using global id as a start for numbering in object</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153196#M21913</link>
      <description>I figured it was the SPLIT function, I was just writing it incorrectly.  I originally failed to put '%n' in quotes.  After a quick check of the GDL Cookbook, I found my error. &lt;BR /&gt;
 &lt;BR /&gt;
The working code is: &lt;BR /&gt;
 &lt;BR /&gt;
if use_glob_id then &lt;BR /&gt;
	x=SPLIT(GLOB_ID,'%n',start_num) &lt;BR /&gt;
	PARAMETERS start_num=start_num &lt;BR /&gt;
endif</description>
      <pubDate>Tue, 08 Dec 2009 17:59:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Using-global-id-as-a-start-for-numbering-in-object/m-p/153196#M21913</guid>
      <dc:creator>jshuether</dc:creator>
      <dc:date>2009-12-08T17:59:03Z</dc:date>
    </item>
  </channel>
</rss>

