<?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: Incorrect vallues calculated for parameter list in Libraries &amp; objects</title>
    <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147778#M16902</link>
    <description>Still not sure why this is happening, but if I remover the riserQuantity variable from the riser height calculation and use the actual value, the angle is calculating properly.</description>
    <pubDate>Tue, 26 Jul 2011 14:13:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-07-26T14:13:39Z</dc:date>
    <item>
      <title>Incorrect vallues calculated for parameter list</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147776#M16900</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;&lt;R&gt;I am working on developing a typical stair.  I am trying to get some base calculations done, and the part is returning incorrect values to the parameter list the first time it is run.  The second time the object is run, it will update to the correct values.  I am banging my head trying to figure out what is wrong, and hoping a fresh set of eyes can see it. I am attaching the stair, but the code is here as well.  All the calculation is in the Parameter script, so I don't think there is any execution order problems.
&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;VALUES "ZZYZX" 128", 168", 176", 192"

IF ZZYZX &amp;lt; 192" THEN
	IF ZZYZX &amp;lt; 176" THEN
		IF ZZYZX &amp;lt; 168" THEN
			PARAMETERS riserQuantity = 20
			PARAMETERS riserHeight=ZZYZX/riserQuantity
			LOCK "riserHeight"
		ELSE
			PARAMETERS riserQuantity = 24
			PARAMETERS riserHeight=ZZYZX/riserQuantity
			LOCK "riserHeight"
		ENDIF
	ELSE
		PARAMETERS riserQuantity = 26
		PARAMETERS riserHeight=ZZYZX/riserQuantity
		LOCK "riserHeight"
	ENDIF
ELSE
	PARAMETERS riserQuantity = 28
	PARAMETERS riserHeight=(ZZYZX/riserQuantity)
	LOCK "riserHeight"
ENDIF

!PARAMETERS stringerAngle = ATN(riserHeight/treadDepth)  !!Doesn't calculate correct angle
PARAMETERS stringerAngle = ATN((ZZYZX/riserQuantity)/treadDepth) !!Calculates correct angle
LOCK "stringerAngle"

PARAMETERS stringerAngleTan = TAN(stringerAngle)&lt;/PRE&gt;&lt;/R&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 25 Jul 2011 22:15:24 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147776#M16900</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-25T22:15:24Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect vallues calculated for parameter list</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147777#M16901</link>
      <description>And a screen shot showing the value displayed in the parameter list and a the same value Using a PRINT command.  I would be fine is the parameter values was incorrect, but the part is using the incorrect value elsewhere making geometry incorrect the first time the object is generated.&lt;BR /&gt;&lt;IMG src="http://community.graphisoft.com/t5/image/serverpage/image-id/67973i836D71439085ABE5/image-size/large?v=v2&amp;amp;px=999" border="0" alt="incorrect value.jpg" title="incorrect value.jpg" /&gt;</description>
      <pubDate>Mon, 25 Jul 2011 22:20:35 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147777#M16901</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-25T22:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect vallues calculated for parameter list</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147778#M16902</link>
      <description>Still not sure why this is happening, but if I remover the riserQuantity variable from the riser height calculation and use the actual value, the angle is calculating properly.</description>
      <pubDate>Tue, 26 Jul 2011 14:13:39 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147778#M16902</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-26T14:13:39Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect vallues calculated for parameter list</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147779#M16903</link>
      <description>Hello,&lt;BR /&gt;
&lt;BR /&gt;
I think you should declare the values first,&lt;BR /&gt;
using the parameters command only &lt;BR /&gt;
sets the user values and runs occasionally.&lt;BR /&gt;

&lt;BLOCKQUOTE&gt;
...&lt;BR /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;IF ZZYZX &amp;lt; 168" THEN &lt;BR /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;PARAMETERS riserQuantity = 20 &lt;BR /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;PARAMETERS riserHeight=ZZYZX/riserQuantity &lt;BR /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;LOCK "riserHeight" &lt;BR /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;ELSE &lt;BR /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp;PARAMETERS riserQuantity = 24 &lt;BR /&gt;
...
&lt;/BLOCKQUOTE&gt;

&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
For example;&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;...
riserQuantity = 20 
riserHeight=ZZYZX/riserQuantity
PARAMETERS riserQuantity = riserQuantity, riserHeight = riserHeight
...
&lt;/PRE&gt;

Hope this works / helps.&lt;BR /&gt;
&lt;BR /&gt;
Regards, Juha</description>
      <pubDate>Wed, 27 Jul 2011 18:40:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147779#M16903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-27T18:40:18Z</dc:date>
    </item>
    <item>
      <title>Re: Incorrect vallues calculated for parameter list</title>
      <link>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147780#M16904</link>
      <description>Thanks for the tip, but unfortunately it isn't helping.  I think my issue has something to do with the Circular functions.  I have added in a parameter (stringerAngle2) that takes the TAN of stringerAngle and calculates the arc tangent.  This should give me the original angle, but it is off, and not just a small fraction off.  It is the angle from the previous run of the scripts.  Something isn't updating properly.</description>
      <pubDate>Wed, 27 Jul 2011 20:11:07 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Libraries-objects/Incorrect-vallues-calculated-for-parameter-list/m-p/147780#M16904</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-07-27T20:11:07Z</dc:date>
    </item>
  </channel>
</rss>

