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

Revision history [back]

Below is another option but probably not as readable as Molly's solution.

The reason you can't access the name directly is because DOE2 doesn't treat U-NAMEs as keywords. This differs from other engines such as E+ which has a name field for many objects. In fact, names are always optional in DOE2. The engine uses a "reference table" to differentiate between objects. Each type of object is assigned a specific predefined spot in the reference table, and each instance of that type is stored sequentially starting at that spot. For example, if you look at the Command Table in the BDLKEY.OUT file, you'll see that the reference table start for all SPACE objects is 1723516. That means that if you have three spaces ("space 1", "space 2", and "space 3"), they will have a reference table index of 1723516,1723517, and 1723518. You can use this to create a workaround to your problem. For this to work, you need to know how many spaces are in each floor ahead of time. For example, assume you have 3 floors with 5 spaces on the 1st floor, 3 spaces on the 2nd floor, and 2 spaces on the top floor.

LIGHTING-W/AREA = (
{
  if (#RI() < 1723516 + 5) then
    1.5
  else if (#RI() < 1723516 + 8) then
    1.25
  else
    1.0
  endif
  endif
} )

You can make this a little more readable by making global parameters which hold the index to the first SPACE of each FLR. e.g.

PARAMETER
"Floor 1" = 1723521
"Floor 2" = 1723524
..

Then the expression would look like:

LIGHTING-W/AREA = (
{
  if (#RI() < #PA("Floor 1")) then
    1.5
  else if (#RI() < #PA("Floor 2")) then
    1.25
  else
    1.0
  endif
  endif
} )

Having said all that, according to the documentation, you should be able to access an object by name using

#SI("Floor 1","FLOOR")

But I've only seen the 3 parameter option work for the #SI function. I'm not sure if the 1 and 2 parameter options ever worked.