Question-and-Answer Resource for the Building Energy Modeling Community
Get s tarted with the Help page

Can you Reference an Object by Name in eQUEST Using BDL Functions?

Is there anyway to return an Object/Components name in eQUEST? For example, if a space wanted to get its parent's (a floor) name and assign certain parameters based on the returned name. I can only see to be able to return the value of a parent's keyword value rather than the parent's actual name.

The following example would return the value of the parent's MULTIPLIER keyword, but I would like to be able to return parent's name.

LIGHTING-W/AREA  = (
{switch (Parent( MULTIPLIER ))
case "L01": #pa("L01LTG")}

edit retag close merge delete

I couldn't find anything in the documentation (DOE2.2 Volume 3 - Topics, p.66 and following). I don't have a Windows machine handy to test this. I'm assuming you've tried #P("NAME") and that it didn't work?

( 2017-01-31 08:36:10 -0600 )edit

Per eQUEST the keyword is "NAME", but that doesn't work and neither does "UNAME" or "U-NAME".

( 2017-01-31 09:44:36 -0600 )edit

What are you trying to do? Find a pattern in the name? Or have an actual equality like Name of parent = "Floor 1"?

( 2017-01-31 09:49:04 -0600 )edit

Keyword/Value assignment based on floor name.

( 2017-01-31 10:00:28 -0600 )edit

In this case, a workaround might be possible by trying to match the SymIndex. You would do something like if ParentSym() = SymIndex( "Floor 1", "FLOOR" ). What do you think? Can you try that?

( 2017-01-31 10:03:36 -0600 )edit

Sort by » oldest newest most voted

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.

more

Can you tell me where to find the BDLKEY.OUT file?

( 2018-03-05 10:16:38 -0600 )edit

This doesn't answer your 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.)

more