idf_object | R Documentation |
IdfObject
object.idf_object()
takes a parent Idf
object, an object name or class name, and
returns a corresponding IdfObject.
idf_object(parent, object = NULL, class = NULL)
parent |
An Idf object. |
object |
A valid object ID (an integer) or name (a string). If |
class |
A valid class name (a string). If |
If object
is not given, an empty IdfObject of specified class is created,
with all field values filled with defaults, if possible. Note that
validation is performed when creating, which means that an error may occur if
current validate level does not allow empty required fields.
The empty IdfObject is directly added into the parent Idf object. It is
recommended to use $validate()
method in IdfObject to see what kinds of
further modifications are needed for those empty fields and use $set()
method to set field values.
An IdfObject object.
## Not run:
model <- read_idf(system.file("extdata/1ZoneUncontrolled.idf", package = "eplusr"))
# get an IdfObject using object ID
idf_object(model, 14)
# get an IdfObject using object name (case-insensitive)
idf_object(model, "zone one")
# `class` argument is useful when there are objects with same name in
# different class
idf_object(model, "zone one", "Zone")
# create a new zone
eplusr_option(validate_level = "draft")
zone <- idf_object(model, class = "Zone")
zone
eplusr_option(validate_level = "final")
zone$validate()
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.