Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I think you can sort of get what you want to do using this: LIGHTING-W/AREA = ( {if(#P("POLYGON")==#SI("EL1 Floor Polygon", "FLOOR","POLYGON"))then 1.0 else if (#P("POLYGON")==#SI("EL2 Floor Polygon", "FLOOR","POLYGON"))then 0.5 else no_default endif endif} )

This expression is based on the parent Floor Polygon U-name, rather than the parent Floor U-name. Additionally, you can't use an expression for "X" in the switch statement for "case X:", so you have to use a nested if-then instead which is messy. I have shown only two branches in my example, but you can greatly expand that. I don't know if there is a limit on number of nested if-then statements, or just a limit on number of characters for the user defined expression (I don't recall what that character limit is.)

I think you can sort of get what you want to do using this: this:

LIGHTING-W/AREA  = ( 
{if(#P("POLYGON")==#SI("EL1 Floor Polygon", "FLOOR","POLYGON"))then
  1.0
else if (#P("POLYGON")==#SI("EL2 Floor Polygon", "FLOOR","POLYGON"))then
  0.5
else
  no_default
endif
endif} )

)

This expression is based on the parent Floor Polygon U-name, rather than the parent Floor U-name. Additionally, you can't use an expression for "X" in the switch statement for "case X:", so you have to use a nested if-then instead which is messy. I have shown only two branches in my example, but you can greatly expand that. I don't know if there is a limit on number of nested if-then statements, or just a limit on number of characters for the user defined expression (I don't recall what that character limit is.)

This doesn't answer your actual question about referencing an object by name. However, I think you can sort of get what you want to do using this:

LIGHTING-W/AREA  = ( 
{if(#P("POLYGON")==#SI("EL1 Floor Polygon", "FLOOR","POLYGON"))then
  1.0
else if (#P("POLYGON")==#SI("EL2 Floor Polygon", "FLOOR","POLYGON"))then
  0.5
else
  no_default
endif
endif} )

This expression is based on the parent Floor Polygon U-name, rather than the parent Floor U-name. Additionally, you can't use an expression for "X" in the switch statement for "case X:", so you have to use a nested if-then instead which is messy. I have shown only two branches in my example, but you can greatly expand that. I don't know if there is a limit on number of nested if-then statements, or just a limit on number of characters for the user defined expression (I don't recall what that character limit is.)

This doesn't answer your actual original question about referencing an object by name. However, I think you can sort of get what you want to do using this:

LIGHTING-W/AREA  = ( 
{if(#P("POLYGON")==#SI("EL1 Floor Polygon", "FLOOR","POLYGON"))then
  1.0
else if (#P("POLYGON")==#SI("EL2 Floor Polygon", "FLOOR","POLYGON"))then
  0.5
else
  no_default
endif
endif} )

This expression is based on the parent Floor Polygon U-name, rather than the parent Floor U-name. Additionally, you can't use an expression for "X" in the switch statement for "case X:", so you have to use a nested if-then instead which is messy. I have shown only two branches in my example, but you can greatly expand that. I don't know if there is a limit on number of nested if-then statements, or just a limit on number of characters for the user defined expression (I don't recall what that character limit is.)