Class IdfObject
- Namespace
- EpNet
- Assembly
- EpNet.dll
Represents an individual idf object, as a enumeration of fields
public class IdfObject : IEquatable<IdfObject>
- Inheritance
-
IdfObject
- Implements
- Extension Methods
Constructors
IdfObject()
Creates a new IdfObject instance
public IdfObject()
IdfObject(IEnumerable<string>)
Creates a new IdfObject instance from a IEnumerable of of field strings.
public IdfObject(IEnumerable<string> fields)
Parameters
fields
IEnumerable<string>List of fields
IdfObject(params string[])
Creates a new IdfObject instance from a list of fields
public IdfObject(params string[] fields)
Parameters
fields
string[]List of fields
Properties
Comments
List of idf comments in the object.
public List<string> Comments { get; set; }
Property Value
Count
Number of fields in the object.
public int Count { get; }
Property Value
- int
Number of fields.
Fields
public List<Field> Fields { get; }
Property Value
IdfClass
Idf class of the object (e.g.Runperiod, BuildingSurface:Detailed, Zone...).
public string IdfClass { get; set; }
Property Value
- string
Name of the IdfClass
IdfReader
Reference to the parent IdfReader that owns this IdfObject.
public IdfReader IdfReader { get; set; }
Property Value
- IdfReader
Parent IdfReader
this[int]
Returns the field in a specific position from the idf object
public Field this[int index] { get; }
Parameters
index
intZero-based index of the field.
Property Value
- Field
Field object.
this[string]
Returns the field with a specified name from the idf object
public Field this[string name] { get; }
Parameters
name
stringStandard name of the field (as found in Energy+.idd file)
Property Value
- Field
Field object
Name
Returns the first value of the idfobject. Usually the name.
public string Name { get; set; }
Property Value
- string
Name of the idfobject
PreComments
List of idf comments preceding the object.
public List<string> PreComments { get; set; }
Property Value
Methods
AddField(string, string)
Append one field to an idf object.
public void AddField(string field, string comment = "")
Parameters
AddFields(params string[])
Append fields to an idf object. Comments are defaulted to blank.
public void AddFields(params string[] fields)
Parameters
fields
string[]List of fields
Clone()
Returns a copy of the specified idf object.
public IdfObject Clone()
Returns
- IdfObject
Cloned idf object.
ContainsValue(string)
Returns true if any field of the idfobject contains the provided string value
public bool ContainsValue(string value)
Parameters
value
stringvalue to search for
Returns
- bool
true if contains the value. false otherwise.
Equals(IdfObject)
Determines whether this instance and a specified object, have the same field values.
public bool Equals(IdfObject obj)
Parameters
obj
IdfObject
Returns
- bool
true if all the fields are the same as in this instance; otherwise, false.
EqualsParameters(IdfObject)
Determines whether all the fields, but the name, in two specified idf objects are equal.
public bool EqualsParameters(IdfObject idfObject)
Parameters
idfObject
IdfObjectSecond object to be compared with.
Returns
- bool
true if equal but name
InsertField(int, string, string)
Insert one field to an idf object at the specified index.
public void InsertField(int index, string field, string comment = "")
Parameters
index
intThe zero-based index at which the field will be inserted
field
stringField value
comment
stringField comment
InsertFields(int, params string[])
Insert a list of fields to an idf object at the specified index. Comments are defaulted to blank.
public void InsertFields(int index, params string[] fields)
Parameters
RemoveField(int)
Remove one field to an idf object.
public void RemoveField(int index)
Parameters
index
intField index
RemoveFields(int, int)
Remove fields to an idf object.
public void RemoveFields(int index, int count)
Parameters
ToString()
Gets the formatted text representation of the idf object in EnergyPlus format including comments.
public override string ToString()
Returns
- string
idf text string.
ToString(bool)
Gets the formatted text representation of the idf object in EnergyPlus format
public string ToString(bool comments)
Parameters
comments
boolsets whether comments are included in the output string.
Returns
- string
idf text string.
Values(int, int, int)
Returns a selection of the string values of the fields
public IEnumerable<string> Values(int start = 1, int skip = 1, int end = 1000)
Parameters
start
intFirst position to start
skip
intValues to skip between previous and next selected value
end
intLast position to select
Returns
- IEnumerable<string>
List of selected values
Operators
operator ==(IdfObject, IdfObject)
Determines whether all the fields, including the name, in two specified idf objects are equal.
public static bool operator ==(IdfObject a, IdfObject b)
Parameters
Returns
- bool
true if the value of a is the same as the value of b; otherwise, false.
operator !=(IdfObject, IdfObject)
Determines if two specified idf objects are different by at least one field.
public static bool operator !=(IdfObject a, IdfObject b)
Parameters
Returns
- bool
false if the all the fields in a are the same as the fields in b; otherwise, true.