<?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: setting gdl globals from apx in GDL</title>
    <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76111#M5011</link>
    <description>&lt;BLOCKQUOTE&gt;adambutler wrote:&lt;BR /&gt;Is a way to set these globals programmatically (in my apx)?&lt;BR /&gt;
Is there a way to guarantee that on a regen the data block script will run before any other scripts?&lt;BR /&gt;
Has anybody had similar problems?&lt;/BLOCKQUOTE&gt;

Have you tried calling the data block script as a macro from the objects which rely on the global values?</description>
    <pubDate>Tue, 03 May 2005 14:25:17 GMT</pubDate>
    <dc:creator>Ralph Wessel</dc:creator>
    <dc:date>2005-05-03T14:25:17Z</dc:date>
    <item>
      <title>setting gdl globals from apx</title>
      <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76110#M5010</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hello,&lt;BR /&gt;
&lt;BR /&gt;
In my companies very customized ArchiCAD setup, we have used the glob_user global variables to share certain global data between various library parts. I have a library part that exists on every job which sets these values (I call it the 'data block').  The idea was that my apx would only need to set parameters of this one part, it populates the globals in its master script and all other library parts can use these variables.&lt;BR /&gt;
&lt;BR /&gt;
This approach has been mostly working fine, but recently I have noticed that sometimes the global values get reset. One example being when ArchiCAD is first opened. Since the values are not there any parts that use them don't work and dimensions that run off them get deleted on the regen. I posted another example of this problem to the GDL forum last week (&lt;A href="http://archicad-talk.graphisoft.com/viewtopic.php?t=6553" target="_blank"&gt;&lt;LINK_TEXT text="http://archicad-talk.graphisoft.com/vie ... php?t=6553"&gt;http://archicad-talk.graphisoft.com/viewtopic.php?t=6553&lt;/LINK_TEXT&gt;&lt;/A&gt;) but have since thought its more of a developer issue.&lt;BR /&gt;
&lt;BR /&gt;
Is a way to set these globals programmatically (in my apx)?&lt;BR /&gt;
Is there a way to guarantee that on a regen the data block script will run before any other scripts?&lt;BR /&gt;
Has anybody had similar problems?&lt;BR /&gt;
&lt;BR /&gt;
I am thinking about removing glob_user variables completely, and either sharing using a file or maybe updating parameters of all relevant library parts on change of the data block. I'm interested of any other solutions that have worked for people?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Adam&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 23 May 2023 14:41:11 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76110#M5010</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-23T14:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: setting gdl globals from apx</title>
      <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76111#M5011</link>
      <description>&lt;BLOCKQUOTE&gt;adambutler wrote:&lt;BR /&gt;Is a way to set these globals programmatically (in my apx)?&lt;BR /&gt;
Is there a way to guarantee that on a regen the data block script will run before any other scripts?&lt;BR /&gt;
Has anybody had similar problems?&lt;/BLOCKQUOTE&gt;

Have you tried calling the data block script as a macro from the objects which rely on the global values?</description>
      <pubDate>Tue, 03 May 2005 14:25:17 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76111#M5011</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-05-03T14:25:17Z</dc:date>
    </item>
    <item>
      <title>Re: setting gdl globals from apx</title>
      <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76112#M5012</link>
      <description>This will not work because the instance of the data block on the drawing has parameters set which are used to set the globals. If I call it like a macro I will be getting the values of the default parameters.</description>
      <pubDate>Wed, 04 May 2005 03:04:08 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76112#M5012</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-04T03:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: setting gdl globals from apx</title>
      <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76113#M5013</link>
      <description>&lt;BLOCKQUOTE&gt;adambutler wrote:&lt;BR /&gt;This will not work because the instance of the data block on the drawing has parameters set which are used to set the globals. If I call it like a macro I will be getting the values of the default parameters.&lt;/BLOCKQUOTE&gt;

What if you passed the parameters of the object instance to the macro? Can it be written to set the globals according to the input it receives?&lt;BR /&gt;
&lt;BR /&gt;
BTW, in answer to your original question; I don't know of a way to directly set GDL globals through the API. There is a separate API for GDL, but I don't know if GS is releasing it publicly or even actively developing it. I employ a technique for indirectly exchanging data between the API and GDL, but I think there may be an easier route in your case.</description>
      <pubDate>Wed, 04 May 2005 10:18:44 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76113#M5013</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2005-05-04T10:18:44Z</dc:date>
    </item>
    <item>
      <title>Re: setting gdl globals from apx</title>
      <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76114#M5014</link>
      <description>Hi Adam,&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure I understand your problem in all its details, but here's how GDL globals are set up in AC:&lt;BR /&gt;
&lt;BR /&gt;
- GDL globals are not stored in the plan.&lt;BR /&gt;
- GDL globals are reset to a default value at every startup and "New and Reset".&lt;BR /&gt;
- After startup, "New and Reset" and library change the master scripts are run (which can then manipulate the globals).&lt;BR /&gt;
&lt;BR /&gt;
So if you want to preserve the value of a GDL global then you have to store it somewhere yourself.&lt;BR /&gt;
&lt;BR /&gt;
HTH:&lt;BR /&gt;
Andras.</description>
      <pubDate>Thu, 05 May 2005 11:27:05 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76114#M5014</guid>
      <dc:creator>Andras Babos</dc:creator>
      <dc:date>2005-05-05T11:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: setting gdl globals from apx</title>
      <link>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76115#M5015</link>
      <description>Thanks guys for your input.&lt;BR /&gt;
&lt;BR /&gt;
I managed to fix the problem - tracked it down to the way parameters of this object were set by my apx. I think I was restoring the default values of the library part before setting the new parameters which caused the master script to get run with outdated values. I'll have to look into the way I set parameters a bit more sometime. Its working fine now, but maybe not as efficiently as it could be.</description>
      <pubDate>Fri, 10 Jun 2005 07:29:04 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/GDL/setting-gdl-globals-from-apx/m-p/76115#M5015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-06-10T07:29:04Z</dc:date>
    </item>
  </channel>
</rss>

