Results 1 to 5 of 5

Thread: Formula Help in ABS2007.1

  1. #1
    ACA/AMEP Community Chair stelthorst's Avatar
    Join Date
    2003-10
    Location
    San Francisco CA
    Posts
    1,190
    Login to Give a bone
    0

    Default Formula Help in ABS2007.1

    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,
    Scott Telthorst
    Quality Control Manager
    Helix Electric, Inc.
    www.helixelectric.com

    Some see the glass as half full, others as half empty. As an engineer I see the glass as twice as big as it needs to be. ~Unknown~

  2. #2
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Formula Help in ABS2007.1

    Quote Originally Posted by stelthorst
    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.
    Code:
    
    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.
    Attached Files Attached Files

  3. #3
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Formula Help in ABS2007.1

    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.

  4. #4
    ACA/AMEP Community Chair stelthorst's Avatar
    Join Date
    2003-10
    Location
    San Francisco CA
    Posts
    1,190
    Login to Give a bone
    0

    Default Re: Formula Help in ABS2007.1

    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.
    Scott Telthorst
    Quality Control Manager
    Helix Electric, Inc.
    www.helixelectric.com

    Some see the glass as half full, others as half empty. As an engineer I see the glass as twice as big as it needs to be. ~Unknown~

  5. #5
    Super Moderator dkoch's Avatar
    Join Date
    2003-03
    Location
    Philadelphia, PA
    Posts
    2,392
    Login to Give a bone
    0

    Default Re: Formula Help in ABS2007.1

    Quote Originally Posted by stelthorst
    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....

Similar Threads

  1. AMEP2008 vs. ABS2007.1
    By finney13 in forum AMEP General
    Replies: 3
    Last Post: 2007-12-10, 07:34 PM
  2. MvParts in ABS2007
    By ordengate in forum Parts Builder
    Replies: 1
    Last Post: 2007-03-31, 12:36 AM
  3. ABS2007 Property set help
    By stelthorst in forum Style Management
    Replies: 6
    Last Post: 2007-03-27, 12:11 PM
  4. ABS2007 Property Set Formula Help
    By stelthorst in forum Style Management
    Replies: 2
    Last Post: 2007-03-01, 11:45 PM
  5. DST files in ABS2007
    By finney13 in forum Project Navigator
    Replies: 4
    Last Post: 2007-02-26, 06:18 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •