<?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: IF-OR-THEN Statement in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280241#M3115</link>
    <description>&lt;BLOCKQUOTE&gt;Lingwisyer wrote:&lt;BR /&gt;
I can get the parameter to change by using that in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Parameter Script&lt;E&gt;&lt;/E&gt;, but am unable to link it to the view type...
&lt;/BLOCKQUOTE&gt;

Remember GLOB_VIEW_TYPE is view dependant so will not work in the master script when it is run as the parameter script (i.e. you can not set the parameter).&lt;BR /&gt;
And of course you can not set the parameters from the 2D or 3D scripts either.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
    <pubDate>Wed, 30 Jan 2019 03:20:53 GMT</pubDate>
    <dc:creator>Barry Kelly</dc:creator>
    <dc:date>2019-01-30T03:20:53Z</dc:date>
    <item>
      <title>IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280235#M3109</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;Hi all,&lt;BR /&gt;
&lt;BR /&gt;
I appear to be unable to create an &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;IF-OR-THEN Statement&lt;E&gt;&lt;/E&gt;. When I try, the statement is ignored...&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;If _clean = 1 then
	If GLOB_VIEW_TYPE = 4 or 5 then
			_status = 8
		else
			_status = 15
	endIf
endIf&lt;/PRE&gt;

&lt;BR /&gt;
I would rather not need to duplicate the statement for each case...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 29 Jan 2019 03:43:25 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280235#M3109</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-29T03:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280236#M3110</link>
      <description>What script are you using this in?&lt;BR /&gt;
It is view dependent so won't work in parameter (master) or property scripts.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Tue, 29 Jan 2019 03:56:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280236#M3110</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-01-29T03:56:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280237#M3111</link>
      <description>I tried it in the Master and 3D scripts.&lt;BR /&gt;
&lt;BR /&gt;
If I put just one of the views it works fine in the Master.&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Tue, 29 Jan 2019 04:18:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280237#M3111</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-29T04:18:18Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280238#M3112</link>
      <description>I would be wary of using it in the master script.&lt;BR /&gt;
It may seem OK when you are looking at your object in 2D or 3D as the master script is run before the 2D and 3D scripts.&lt;BR /&gt;
But it is also run before the parameter script is run so if you are adjusting parameters it may return the wrong values.&lt;BR /&gt;
The master script is run many times when you interact with an object.&lt;BR /&gt;
&lt;BR /&gt;
It is better to just be in the 2D and/or 3D scripts.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Tue, 29 Jan 2019 05:22:40 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280238#M3112</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-01-29T05:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280239#M3113</link>
      <description>Try this one&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;If _clean = 1 then
	If (GLOB_VIEW_TYPE = 4 or GLOB_VIEW_TYPE = 5) then
			_status = 8
		else
			_status = 15
	endIf
endIf
&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Jan 2019 17:53:15 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280239#M3113</guid>
      <dc:creator>Nader Belal</dc:creator>
      <dc:date>2019-01-29T17:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280240#M3114</link>
      <description>No difference...&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;If _clean = 1 then
		_status = 8
		PARAMETERS _status = 8
	else
		_status = 15
		PARAMETERS _status = 15
endIf&lt;/PRE&gt;

&lt;BR /&gt;
I can get the parameter to change by using that in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Parameter Script&lt;E&gt;&lt;/E&gt;, but am unable to link it to the view type...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 30 Jan 2019 02:01:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280240#M3114</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-30T02:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280241#M3115</link>
      <description>&lt;BLOCKQUOTE&gt;Lingwisyer wrote:&lt;BR /&gt;
I can get the parameter to change by using that in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Parameter Script&lt;E&gt;&lt;/E&gt;, but am unable to link it to the view type...
&lt;/BLOCKQUOTE&gt;

Remember GLOB_VIEW_TYPE is view dependant so will not work in the master script when it is run as the parameter script (i.e. you can not set the parameter).&lt;BR /&gt;
And of course you can not set the parameters from the 2D or 3D scripts either.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 30 Jan 2019 03:20:53 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280241#M3115</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-01-30T03:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280242#M3116</link>
      <description>I tried that above in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;Parameter Script&lt;E&gt;&lt;/E&gt; with a different section in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;3D Script&lt;E&gt;&lt;/E&gt; to make A = B with the view but that did not work... This is all for a status code toggle in the &lt;I&gt;&lt;/I&gt;&lt;S&gt;&lt;I&gt;&lt;I&gt;&lt;/I&gt;&lt;/I&gt;&lt;/S&gt;3D Script&lt;E&gt;&lt;/E&gt; but so far making any changes to the status code variable within the same script has broken it...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 30 Jan 2019 03:42:51 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280242#M3116</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-30T03:42:51Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280243#M3117</link>
      <description>You can set the status code for use in the 2D and 3D scripts, but you can't set a parameter for it as you can't do that from the 2D and 3D scripts.&lt;BR /&gt;
&lt;BR /&gt;
You can only set the parameter from the master or parameter script, but you can't use GLOB_VIEW_TYPE there.&lt;BR /&gt;
&lt;BR /&gt;
So you will have to determine the GLOB_VIEW_TYPE at the beginning of the 2D and 3D script to set your status code.&lt;BR /&gt;
The following parts of those scripts can then use that status code - but you will never see it as a parameter if that is what you are trying to do.&lt;BR /&gt;
&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 30 Jan 2019 05:55:42 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280243#M3117</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-01-30T05:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280244#M3118</link>
      <description>I originally had the code in my original post in the 3D script but got an error about an undefined variable later in the script regarding the output of the IF statement. &lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;If _clean = 1 then
		If (GLOB_VIEW_TYPE = 4 or GLOB_VIEW_TYPE = 5) then status = 8
	else
		_status = 15
endIf&lt;/PRE&gt;

&lt;BR /&gt;
The following section returns an error about an undefined variable.&lt;BR /&gt;
&lt;BR /&gt;

&lt;PRE&gt;cprism_ louvtopmat, louvbotmat, louvsidemat,
	5, gs_louvre_thk,
	-a / 2 + gs_fw_side_right + gs_int_fw,	-(gs_louvre_width) / 2,	_status,
	-a / 2 + gs_fw_side_right + gs_int_fw,	 (gs_louvre_width) / 2,	_status,
	 a / 2 - gs_fw_side_left - gs_int_fw,	 (gs_louvre_width) / 2,	_status,
	 a / 2 - gs_fw_side_left - gs_int_fw,	-(gs_louvre_width) / 2,	_status,
	-a / 2 + gs_fw_side_right + gs_int_fw,	-(gs_louvre_width) / 2,	-1&lt;/PRE&gt;

&lt;BR /&gt;
Even if I put "_status = 15" at the start, it will say that it is undefined and will not generate the relevant parts properly... It effectively uses "_status = 0". If I define it in the parameters, then it will use that instead...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 30 Jan 2019 09:08:43 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280244#M3118</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-30T09:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280245#M3119</link>
      <description>It might not be the status variable that is undefined?&lt;BR /&gt;
&lt;BR /&gt;
I just tried this and apart from the missing materials there are no errors.&lt;BR /&gt;
&lt;BR /&gt;



&lt;BR /&gt;
Barry.</description>
      <pubDate>Wed, 30 Jan 2019 09:20:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280245#M3119</guid>
      <dc:creator>Barry Kelly</dc:creator>
      <dc:date>2019-01-30T09:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: IF-OR-THEN Statement</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280246#M3120</link>
      <description>That is odd. The materials generate properly for me so I did not think it was the materials causing the error. That and the fact that the error only pops up when I do not define _status in the parameters...&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Ling.</description>
      <pubDate>Wed, 30 Jan 2019 09:57:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/IF-OR-THEN-Statement/m-p/280246#M3120</guid>
      <dc:creator>Lingwisyer</dc:creator>
      <dc:date>2019-01-30T09:57:41Z</dc:date>
    </item>
  </channel>
</rss>

