<?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: Date of placing object - problem in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295409#M8119</link>
    <description>Firstly you need to set the default value of your 'firstRun' parameter to "1" or anything other than zero.&lt;BR /&gt;
However I would change this to ...&lt;BR /&gt;

&lt;PRE&gt;IF GLOB_VIEW_TYPE = 2 THEN         !do only in 2D 
      IF firstRun = 0 THEN            !parameter that allow to run code only once 
         ch = OPEN ("DateTime", "", "%Y/%m/%d, %H:%M%P") 
         n = INPUT (ch, "", "", date) 
         CLOSE (ch) 
         parameters firstRun = 1   !prevents running code again 
         parameters date = date 
      ENDIF 
ENDIF 
&lt;/PRE&gt;

Because the default value for 'firstRun' if not set will already be zero.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Having said that I am not sure if this is a bug or not.&lt;BR /&gt;
GLOB_VIEW_TYPE = 2 does not work as the 'firstRun' parameter is set while you are in the library part editor and you can not change it.&lt;BR /&gt;
Try and change it manually in the parameter list and you can't.&lt;BR /&gt;
If you change it to GLOB_VIEW_TYPE = 3 (just as an experiment) you will find that you can change the parameter value.&lt;BR /&gt;
&lt;BR /&gt;
You need a way to block the library part editor from running this part of the script.&lt;BR /&gt;
Back in version 18 (and before) we could use 'IF GLOB_CONTEXT &amp;lt;&amp;gt; 1' but this is no longer available in 19/20.&lt;BR /&gt;
And there is no equivalent command to detect that you are in the library part editor any more.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
    <pubDate>Mon, 04 Jul 2016 01:10:30 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2016-07-04T01:10:30Z</dc:date>
    <item>
      <title>Date of placing object - problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295408#M8118</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi, &lt;BR /&gt;
 &lt;BR /&gt;
I'm trying to create object which displays it's creation date as a text.  &lt;BR /&gt;
 &lt;BR /&gt;
Creation date means moment when object is placing on 2d view. I'm trying different conditions which prevent changing date after first run, with no effect.  &lt;BR /&gt;
 &lt;BR /&gt;
Can anyone tell me if is that ever possible? &lt;BR /&gt;
 &lt;BR /&gt;
Here is example of one of my attempts: &lt;BR /&gt;
 
&lt;PRE&gt;IF GLOB_VIEW_TYPE = 2 THEN			!do only in 2D 
		IF firstRun THEN				!parameter that allow to run code only once 
			ch = OPEN ("DateTime", "", "%Y/%m/%d, %H:%M%P") 
			n = INPUT (ch, "", "", date) 
			CLOSE (ch) 
			parameters firstRun = 0	!prevents running code again
			parameters date = date 
		ENDIF 
ENDIF &lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 02 Jul 2016 22:57:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295408#M8118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-02T22:57:43Z</dc:date>
    </item>
    <item>
      <title>Re: Date of placing object - problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295409#M8119</link>
      <description>Firstly you need to set the default value of your 'firstRun' parameter to "1" or anything other than zero.&lt;BR /&gt;
However I would change this to ...&lt;BR /&gt;

&lt;PRE&gt;IF GLOB_VIEW_TYPE = 2 THEN         !do only in 2D 
      IF firstRun = 0 THEN            !parameter that allow to run code only once 
         ch = OPEN ("DateTime", "", "%Y/%m/%d, %H:%M%P") 
         n = INPUT (ch, "", "", date) 
         CLOSE (ch) 
         parameters firstRun = 1   !prevents running code again 
         parameters date = date 
      ENDIF 
ENDIF 
&lt;/PRE&gt;

Because the default value for 'firstRun' if not set will already be zero.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Having said that I am not sure if this is a bug or not.&lt;BR /&gt;
GLOB_VIEW_TYPE = 2 does not work as the 'firstRun' parameter is set while you are in the library part editor and you can not change it.&lt;BR /&gt;
Try and change it manually in the parameter list and you can't.&lt;BR /&gt;
If you change it to GLOB_VIEW_TYPE = 3 (just as an experiment) you will find that you can change the parameter value.&lt;BR /&gt;
&lt;BR /&gt;
You need a way to block the library part editor from running this part of the script.&lt;BR /&gt;
Back in version 18 (and before) we could use 'IF GLOB_CONTEXT &amp;lt;&amp;gt; 1' but this is no longer available in 19/20.&lt;BR /&gt;
And there is no equivalent command to detect that you are in the library part editor any more.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Mon, 04 Jul 2016 01:10:30 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295409#M8119</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2016-07-04T01:10:30Z</dc:date>
    </item>
    <item>
      <title>Re: Date of placing object - problem</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295410#M8120</link>
      <description>Thanks for help Barry,&lt;BR /&gt;
&lt;BR /&gt;
sadly I have tried before everything what you wrote and even more. It looks like there is no way to do this in AC19+ ;/</description>
      <pubDate>Mon, 04 Jul 2016 18:50:37 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Date-of-placing-object-problem/m-p/295410#M8120</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-07-04T18:50:37Z</dc:date>
    </item>
  </channel>
</rss>

