See the top rated post in this thread. Click here

Results 1 to 3 of 3

Thread: Property Set Definition Formula for Occupant Load Schedule

  1. #1
    Woo! Hoo! my 1st post
    Join Date
    2006-06
    Posts
    1
    Login to Give a bone
    0

    Default Property Set Definition Formula for Occupant Load Schedule

    Hey, I'm trying to create a property set definition formula to calculate the occupant load for a group of rooms. I created two new property set definitions: one is for the user to input the building code "occupants per sf" and one for "occupancy per equipment". In some rooms we design the occupant load based on the design (not a prescribed value).

    The goal is to have a column in the schedule to output the number of persons permitted.
    I would like to create a formula that looks to the "occupants per sf" property definition first; if the user entered "0" then the formula would display the number from the "occupancy per equipment" property definition. Otherwise if the "occupants per sf" property definition is anything other than "0", the formula would calculate the "net area" / "occupants per sf".

    The problem is I can't get it to calculate correctly using if...then...else statements
    I can only get the formula to calculate one formula. it works when I type "if...then" but as after I type an "else" statement, the sample result just displays the formula (it doesn't calculate the answer).

    This part works:
    Code:
    If [OccupancyPerSF]=0 Then RESULT=[OccupancyPerEquip]
    This is what I want, but have a problem with the calculation:
    Code:
    If [OccupancyPerSF]=0 Then RESULT=[OccupancyPerEquip] Else RESULT=[SpaceStyles:NetArea]/[OccupancyPerSF] End If

  2. #2
    Super Moderator CAtDiva's Avatar
    Join Date
    2015-10
    Location
    Where pedals spin to move wheels
    Posts
    441
    Login to Give a bone
    0

    Default Re: Property Set Definition Formula for Occupant Load Schedule

    Quote Originally Posted by t.scibilia View Post
    Hey, I'm trying to create a property set definition formula to calculate the occupant load for a group of rooms. I created two new property set definitions: one is for the user to input the building code "occupants per sf" and one for "occupancy per equipment". In some rooms we design the occupant load based on the design (not a prescribed value).

    The goal is to have a column in the schedule to output the number of persons permitted.
    I would like to create a formula that looks to the "occupants per sf" property definition first; if the user entered "0" then the formula would display the number from the "occupancy per equipment" property definition. Otherwise if the "occupants per sf" property definition is anything other than "0", the formula would calculate the "net area" / "occupants per sf".

    The problem is I can't get it to calculate correctly using if...then...else statements
    I can only get the formula to calculate one formula. it works when I type "if...then" but as after I type an "else" statement, the sample result just displays the formula (it doesn't calculate the answer).

    This part works:
    Code:
    If [OccupancyPerSF]=0 Then RESULT=[OccupancyPerEquip]
    This is what I want, but have a problem with the calculation:
    Code:
    If [OccupancyPerSF]=0 Then RESULT=[OccupancyPerEquip] Else RESULT=[SpaceStyles:NetArea]/[OccupancyPerSF] End If
    Which software are you using (looks like it's AutoCAD Architecture)?

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

    Default Re: Property Set Definition Formula for Occupant Load Schedule

    AutoCAD Architecture is going to evaluate the entire formula, not just the logical branch that would be evaluated for a given case. So, when [OccupancyPerSF] is set to 0, even though only the true condition would need to be evaluated, the false (Else) condition will also be evaluated, and that will result in division by 0, which causes the formula to fail.

    You will want to use something like this, which makes the same test, but avoids division by zero:
    Code:
    If [OccupancyPerSF] = 0 Then
    	occPerSF = 1
    Else
    	occPerSF = [OccupancyPerSF]
    End If
    
    If [OccupancyPerSF] = 0 Then
    	RESULT = [OccupancyPerEquip]
    Else
    	RESULT = [SpaceStyles:NetArea]/occPerSF
    End If
    You could also choose to always have a non-zero value in [OccupancyPerSF] (make the default value 1 and instruct users never to set it to 0) and make your test based on whether OccupancyPerEquip is zero or not. If it is zero, then set the result to [SpaceStyles:NetArea]/[OccupancyPerSF], otherwise, set it to [OccupancyPerSF].

    Note that the above does not apply any rounding; I would expect an occupant load calculation to always round any fractional amount up to the next whole number. The following builds on the previous, and rounds up any fractional amount when [SpaceStyles:NetArea]/[OccupancyPerSF] is calculated.
    Code:
    If [OccupancyPerSF] = 0 Then
    	occPerSF = 1
    Else
    	occPerSF = [OccupancyPerSF]
    End If
    
    If [OccupancyPerSF] = 0 Then
    	RESULT = [OccupancyPerEquip]
    Else
    	occTotal = [SpaceStyles:NetArea]/occPerSF
    	occTotalWhole = Fix( occTotal )
    	occTotalFract = occTotal - occTotalWhole
    	If occTotalFract > 0 Then
    		occTotal = occTotalWhole + 1
    	Else
    		occTotal = occTotalWhole
    	End If
    	RESULT = occTotal
    End If
    Also, make certain that the [SpaceStyles:NetArea] value does not have a Property Data Format that adds any text, such as a " SF" suffix. You do not have to alter the [SpaceStyles:NetArea] property itself; in your formula property, in the Sample Values area, you can specify a different format, such as Standard, that does not add text to the numeric value in a prefix or suffix.
    Last edited by dkoch; 2016-04-13 at 05:34 PM.

Similar Threads

  1. Formula Property Definition PLEASE HELP
    By douglas.167342 in forum ACA General
    Replies: 1
    Last Post: 2010-02-18, 10:34 AM
  2. Occupant Load Schedule - Round Up?
    By saeborne in forum Revit Architecture - General
    Replies: 11
    Last Post: 2008-10-12, 12:17 AM
  3. Formula Property Definition
    By jgardner.79905 in forum VBA/COM Interop
    Replies: 3
    Last Post: 2006-06-13, 12:58 PM
  4. Writing formulas for occupant load schedule
    By dmarch in forum CAD Management - General
    Replies: 6
    Last Post: 2006-05-03, 02:01 PM
  5. Formula Property Definition
    By arcadia_x27 in forum ACA General
    Replies: 1
    Last Post: 2004-09-10, 06:26 PM

Tags for this Thread

Posting Permissions

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