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

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

asked 2017-01-30 11:10:44 -0600

pflaumingo gravatar image

updated 2017-01-31 07:41:24 -0600

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.

{switch (Parent( MULTIPLIER ))
case "L01": #pa("L01LTG")}
edit retag flag offensive 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?

Julien Marrec gravatar image Julien Marrec  ( 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".

pflaumingo gravatar image pflaumingo  ( 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"?

Julien Marrec gravatar image Julien Marrec  ( 2017-01-31 09:49:04 -0600 )edit

Keyword/Value assignment based on floor name.

pflaumingo gravatar image pflaumingo  ( 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?

Julien Marrec gravatar image Julien Marrec  ( 2017-01-31 10:03:36 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2017-02-01 09:21:23 -0600

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.

  if (#RI() < 1723516 + 5) then
  else if (#RI() < 1723516 + 8) then
} )

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.

"Floor 1" = 1723521
"Floor 2" = 1723524

Then the expression would look like:

  if (#RI() < #PA("Floor 1")) then
  else if (#RI() < #PA("Floor 2")) then
} )

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.

edit flag offensive delete link more


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

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

answered 2017-01-31 11:24:29 -0600

Molly Curtz gravatar image

updated 2017-01-31 11:37:07 -0600

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:

{if(#P("POLYGON")==#SI("EL1 Floor Polygon", "FLOOR","POLYGON"))then
else if (#P("POLYGON")==#SI("EL2 Floor Polygon", "FLOOR","POLYGON"))then
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.)

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer


Question Tools



Asked: 2017-01-30 11:10:44 -0600

Seen: 594 times

Last updated: Feb 01 '17