View Full Version : Formula Help in ABS2007.1
stelthorst
2007-04-13, 07:24 PM
Can someone help me out with this formula. I don't know what I'm doing wrong. For some reason my schedule table shows the formula and not the result. Although in the schedule table the PSD values are shown and not the PSD.
If "[ConduitObject:ConduitSize]<= 2" Then
RESULT= "[ConduitObject:Length]+24"
ElseIf "([ConduitObject:ConduitSize]>2 And [ConduitObject:ConduitSize]<= 3 )" Then
RESULT= "[ConduitObject:Length]+36"
Else
RESULT= "[ConduitObject:Length]+48"
End If
Thanks in advance,
dkoch
2007-04-14, 02:47 PM
Can someone help me out with this formula. I don't know what I'm doing wrong. For some reason my schedule table shows the formula and not the result. Although in the schedule table the PSD values are shown and not the PSD.
If "[ConduitObject:ConduitSize]<= 2" Then
RESULT= "[ConduitObject:Length]+24"
ElseIf "([ConduitObject:ConduitSize]>2 And [ConduitObject:ConduitSize]<= 3 )" Then
RESULT= "[ConduitObject:Length]+36"
Else
RESULT= "[ConduitObject:Length]+48"
End If
Thanks in advance,
When a formula fails, the failed formula, with values being evaluated for that object, is displayed as a means of helping to debug the problem. While not always helpful, there have been times where I have worked out the error by noticing that the value substituted in at a particular place was not what I expected.
That said, you have some extra quotation marks and parentheses in your formula. I do not have ABS, so I had to fake things in ADT 2007, using lines for conduits, but the attached file shows the following formula doing what I believe is the intent of your formula.
If [ConduitObject:ConduitSize] <= 2 Then
RESULT=CDbl( [ConduitObject:Length] + 24 )
ElseIf [ConduitObject:ConduitSize] > 2 And [ConduitObject:ConduitSize] <= 3 Then
RESULT= CDbl( [ConduitObject:Length] + 36 )
Else
RESULT= CDbl([ConduitObject:Length] + 48 )
End If
I tossed in the CDbl on the RESULT lines to force the results to be interpreted as real numbers, so that the Length - Long formatting I applied to the formula property [Test, in the FormulaTest PSD] would show feet and inches. I also created a Property Data Format called Standard-8, which is a copy of the out-of-the-box Standard PDF, with the precision increased to eight decimal places and zero suppression turned off. That allows the numbers in the Length and ConduitSize properties to maintain the highest level of precision when brought into the formula for evaluation. You may not need that level of precision [if I recall correctly, conduit sizes are do not vary by that small of an increment], but there may be occasions when the Standard PDF's three decimal place precision is insufficient.
I also noticed a strange effect - I initially set up the formula property with the Standard PDF on the Length and ConduitSize properties and that was the PDF listed in the test area in the lower right when editing the formula property. The Standard PDF remained in the test area even after I changed it to Standard-8 on the properties themselves, and when entering values in the test lines in the file, the results were coming out as if three-decimal place precision were in effect. I was puzzled by this, and it was only by luck that I eventually noticed the PDF assigned in the test area. Changing that to Standard-8 made the results in the drawing work as expected. I will need to look at this more deeply when I have time.
dkoch
2007-04-15, 10:48 PM
I have looked into the PDF in formula properties thing and have decided it is a feature. If you like, more details on this can be found in this blog article (http://architects-desktop.blogspot.com/2007/04/aca-2008adt-2007-setting-different.html).
stelthorst
2007-04-16, 03:01 PM
Thanks David,
I thought that I had done it originally without the quotation marks and it didn't work. But as soon as I removed the quotation marks everything worked as expected.
Also, great blog article, cleared up alot of questions I had on how PSDs worked. Eventually I'll figure out these formulas and I can quit bugging you but until then thanks for all of your help.
dkoch
2007-04-16, 11:22 PM
Thanks David,
I thought that I had done it originally without the quotation marks and it didn't work. But as soon as I removed the quotation marks everything worked as expected.
Also, great blog article, cleared up alot of questions I had on how PSDs worked. Eventually I'll figure out these formulas and I can quit bugging you but until then thanks for all of your help.
I am glad you found it helpful. And it really do not consider it "bugging" - for whatever reason, I actually enjoy working with formula properties, when I have the time. So keep on asking questions. Not that I will necessarily be able to answer them all....
Powered by vBulletin® Version 4.1.11 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.