Incorrect vallues calculated for parameter list
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-07-26 12:15 AM
2011-07-26
12:15 AM
VALUES "ZZYZX" 128", 168", 176", 192" IF ZZYZX < 192" THEN IF ZZYZX < 176" THEN IF ZZYZX < 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)
4 REPLIES 4
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-07-26 12:20 AM
2011-07-26
12:20 AM
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.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-07-26 04:13 PM
2011-07-26
04:13 PM
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.
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-07-27 08:40 PM
2011-07-27
08:40 PM
Hello,
I think you should declare the values first,
using the parameters command only
sets the user values and runs occasionally.
For example;
Regards, Juha
I think you should declare the values first,
using the parameters command only
sets the user values and runs occasionally.
...
IF ZZYZX < 168" THEN
PARAMETERS riserQuantity = 20
PARAMETERS riserHeight=ZZYZX/riserQuantity
LOCK "riserHeight"
ELSE
PARAMETERS riserQuantity = 24
...
For example;
... riserQuantity = 20 riserHeight=ZZYZX/riserQuantity PARAMETERS riserQuantity = riserQuantity, riserHeight = riserHeight ...Hope this works / helps.
Regards, Juha
Anonymous
Not applicable
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2011-07-27 10:11 PM
2011-07-27
10:11 PM
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.