<?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 to once to declare and initialize variable for many GDL elements in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227936#M2660</link>
    <description>&lt;BLOCKQUOTE&gt;Piotr wrote:&lt;BR /&gt;
Probably LibraryGlobal is a key - can be changed by MVO and then injected to the calling object.&lt;BR /&gt;
&lt;BR /&gt;
Piotr
&lt;/BLOCKQUOTE&gt;

I was going to mention Library Globals and MVO but I ended up deleting it.&lt;BR /&gt;
That will work for resetting values in placed instances of the objects but not the object default (script) values themselves.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
    <pubDate>Tue, 28 May 2019 07:51:37 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2019-05-28T07:51:37Z</dc:date>
    <item>
      <title>How to once to declare and initialize variable for many GDL elements</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227933#M2657</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;T&gt;I need to declare and initialize array.&lt;BR /&gt;
dim my_array[]&lt;BR /&gt;
        my_array[1]="1"&lt;BR /&gt;
        my_array[2]="2"&lt;BR /&gt;
Count of the my_array items can be changed in time to development aims.&lt;BR /&gt;
And need to use it in any my GDL elements of the library.&lt;BR /&gt;
How I can declare andi initialize this array once for all my elements?&lt;BR /&gt;
Help me please(.&lt;/T&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 27 May 2019 08:32:16 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227933#M2657</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-05-27T08:32:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to once to declare and initialize variable for many GDL elements</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227934#M2658</link>
      <description>I have never tried it on multiple objects.&lt;BR /&gt;
Maybe the LP_XMLConverter can do this - I have never used it but I believe it can reset variables in multiple elements.&lt;BR /&gt;
I may be mistaken though - as i say i have never used it.&lt;BR /&gt;
&lt;BR /&gt;
Otherwise you will need to do it individually in each object.&lt;BR /&gt;
I have done this in an object I made so I can easily reset all the array values back to default while I am testing or changing the object.&lt;BR /&gt;
&lt;BR /&gt;
Create a boolean parameter called "reset_defaults_swch"&lt;BR /&gt;
Then add this to the master script (it may work in the parameter script as well, but for some reason I have it in the master script"&lt;BR /&gt;
 
&lt;PRE&gt;if reset_defaults_swch = 1 then
	dim my_array[]
	my_array[1]="1"
	my_array[2]="2"
	
	parameters my_array = my_array

	reset_defaults_swch = 0
	parameters reset_defaults_swch = reset_defaults_swch
endif
&lt;/PRE&gt;

Now just turn on the boolean parameter in the parameter list - it will turn back of instantly but will have reset your array.&lt;BR /&gt;
&lt;BR /&gt;
You could do it without the boolean switch but you would have to manually uncomment/comment the lines otherwise it will always be initialising.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Mon, 27 May 2019 09:23:52 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227934#M2658</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-05-27T09:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to once to declare and initialize variable for many GDL elements</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227935#M2659</link>
      <description>Probably LibraryGlobal is a key - can be changed by MVO and then injected to the calling object.&lt;BR /&gt;
&lt;BR /&gt;
Piotr</description>
      <pubDate>Tue, 28 May 2019 07:27:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227935#M2659</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2019-05-28T07:27:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to once to declare and initialize variable for many GDL elements</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227936#M2660</link>
      <description>&lt;BLOCKQUOTE&gt;Piotr wrote:&lt;BR /&gt;
Probably LibraryGlobal is a key - can be changed by MVO and then injected to the calling object.&lt;BR /&gt;
&lt;BR /&gt;
Piotr
&lt;/BLOCKQUOTE&gt;

I was going to mention Library Globals and MVO but I ended up deleting it.&lt;BR /&gt;
That will work for resetting values in placed instances of the objects but not the object default (script) values themselves.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Tue, 28 May 2019 07:51:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227936#M2660</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-05-28T07:51:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to once to declare and initialize variable for many GDL elements</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227937#M2661</link>
      <description>Ok, I missed the "main" part.&lt;BR /&gt;
So there is another way but the XML tool:&lt;BR /&gt;
- make an object with desired parameters and values&lt;BR /&gt;
- set it as a template&lt;BR /&gt;
- apply the template to the desired objects...&lt;BR /&gt;
(delete the template when necessary ... when deleted it will be allowed to change the template without deleting the previously inserted parameters)&lt;BR /&gt;
&lt;BR /&gt;
Piotr</description>
      <pubDate>Tue, 28 May 2019 10:41:50 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/How-to-once-to-declare-and-initialize-variable-for-many-GDL/m-p/227937#M2661</guid>
      <dc:creator>Piotr Dobrowolski</dc:creator>
      <dc:date>2019-05-28T10:41:50Z</dc:date>
    </item>
  </channel>
</rss>

