Table of Contents

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

List<string>

Idf comments.

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

List<Field>

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 int

Zero-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 string

Standard 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

List<string>

Comments preceding the idf object.

Methods

AddField(string, string)

Append one field to an idf object.

public void AddField(string field, string comment = "")

Parameters

field string

Field value

comment string

Field comment

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 string

value 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 IdfObject

Second 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 int

The zero-based index at which the field will be inserted

field string

Field value

comment string

Field 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

index int

The zero-based index at which the fields will be inserted

fields string[]

List of fields

RemoveField(int)

Remove one field to an idf object.

public void RemoveField(int index)

Parameters

index int

Field index

RemoveFields(int, int)

Remove fields to an idf object.

public void RemoveFields(int index, int count)

Parameters

index int

Start field index

count int

Number of fields to remove

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 bool

sets 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 int

First position to start

skip int

Values to skip between previous and next selected value

end int

Last 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

a IdfObject

The first idf object to compare

b IdfObject

The second idf object to compare.

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

a IdfObject

The first idf object to compare.

b IdfObject

The second idf object to compare.

Returns

bool

false if the all the fields in a are the same as the fields in b; otherwise, true.