GH_IWriter

References
public interface GH_IWriter : GH_IChunk
Provides access to a subset of GH_Chunk methods used for writing archives.

Properties

Archive

GH_Archive Archive { get; }
Gets a pointer to the archive that owns the Root of the tree this chunk belongs to.
inherited fromGH_IChunk

ArchiveLocation

string ArchiveLocation { get; }
Gets a string representing the URI with which the archive is associated. The location may be a null string.
inherited fromGH_IChunk

ChunkCount

int ChunkCount { get; }
Gets the number of child chunks contained in this chunk. The set of all child chunks is referred to as a 'litter'.
inherited fromGH_IChunk

Chunks

List<GH_IChunk> Chunks { get; }
Gets a pointer to the internal list of child chunks. Do not access this list unless you know what you are doing.
inherited fromGH_IChunk

Index

int Index { get; }
Gets the index of this chunk. The index is set by the owner of this chunk. Indices smaller than zero imply no index has been set. The combination of name+index is always unique among a set of chunks in the same litter.
inherited fromGH_IChunk

ItemCount

int ItemCount { get; }
Gets the number of items contained in this chunk.
inherited fromGH_IChunk

Items

List<GH_Item> Items { get; }
Gets a pointer to the internal list of items. Do not access this list unless you know what you are doing.
inherited fromGH_IChunk

Name

string Name { get; }
Gets the name of this chunk. The name is set by the owner of this chunk. Names must be at least 1 character long. The combination of name+index is always unique among a set of chunks in a single litter.
inherited fromGH_IChunk

Methods

AddComment

#
void AddComment(string comment_text)
Adds a text comment to this chunk. Comments are serialized only if the output flavour is a human readable format. Comments are never deserialized, they are purely for the benefit of the humans reading the file data.
comment_text (string)The content of the comment, text might be altered if it contains invalid characters for a chosen format flavour.
ArgumentNullExceptionThrown if the content text is either null or empty.

AddMessage

void AddMessage(string m, GH_Message_Type t)
Log a new message with the top-level archive. Messages are collected during read/write operations, and can be displayed to the user upon completion using GH_Archive.ShowMessageLog().
inherited fromGH_IChunk
m (string)Message text.
t (GH_Message_Type)Message type.

CreateChunk

#
GH_IWriter CreateChunk(string chunk_name, int chunk_index)
Create a new child chunk with the specified name and index qualifier. If another chunk already exists with similar properties, an exception will be thrown.
chunk_name (string)Name of new child.
chunk_index (int)Index of new child.
ArgumentExceptionThrown if the name+index coordinte is already occupied by another chunk.

CreateChunk

#
GH_IWriter CreateChunk(string chunk_name)
Create a new child chunk with the specified name but without an index qualifier. If another chunk already exists with similar properties, an exception will be thrown.
chunk_name (string)Name of new child chunk.
ArgumentExceptionThrown if the name coordinte is already occupied by another chunk.

Read

void Read(BinaryReader reader)
Called when an object is required to deserialize itself.
inherited fromGH_IBinarySupport
reader (BinaryReader)Reader object to be used for deserialization.

Read

void Read(XmlNode node)
Called when an object is required to deserialize itself.
inherited fromGH_IXmlSupport
node (XmlNode)Node object to be used for deserialization.

RemoveChunk

#
bool RemoveChunk(GH_IChunk chunk)
Remove the specified chunk from the litter.
chunk (GH_IChunk)Chunk to remove.
True is chunk was removed, false if chunk is not part of this litter.
ArgumentNullExceptionThrown if chunk is a null reference.

RemoveChunk

#
bool RemoveChunk(string chunk_name, int chunk_index)
Remove the first chunk with a matching name and index. Only chunks with index qualifiers are considered. Name comparisons are not case-sensitive.
chunk_name (string)Name of chunk to remove.
chunk_index (int)Index of chunk to remove.
True is chunk was removed, false if no matching chunk could be found.

RemoveChunk

#
bool RemoveChunk(string chunk_name)
Remove the first chunk with a matching name. Only chunks without index qualifiers are considered. Name comparisons are not case-sensitive.
chunk_name (string)Name of chunk to remove.
True is chunk was removed, false if no matching chunk could be found.

RemoveItem

#
bool RemoveItem(string itemName, int itemIndex)
Remove an indexed item from this chunk.
itemName (string)Name of item.
itemIndex (int)Index of item.
True on success, false on failure.

RemoveItem

#
bool RemoveItem(string itemName)
Remove an unindexed item from this chunk.
itemName (string)Name of item.
True on success, false on failure.

SetBoolean

#
void SetBoolean(string item_name, bool item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (bool)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetBoolean

#
void SetBoolean(string item_name, int item_index, bool item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (bool)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetBoundingBox

#
void SetBoundingBox(string item_name, GH_BoundingBox item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_BoundingBox)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetBoundingBox

#
void SetBoundingBox(string item_name, int item_index, GH_BoundingBox item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_BoundingBox)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetByte

#
void SetByte(string item_name, byte item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (byte)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetByte

#
void SetByte(string item_name, int item_index, byte item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (byte)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetByteArray

#
void SetByteArray(string item_name, byte[] item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (byte[])Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetByteArray

#
void SetByteArray(string item_name, int item_index, byte[] item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (byte[])Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDate

#
void SetDate(string item_name, DateTime item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (DateTime)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDate

#
void SetDate(string item_name, int item_index, DateTime item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (DateTime)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDecimal

#
void SetDecimal(string item_name, decimal item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (decimal)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDecimal

#
void SetDecimal(string item_name, int item_index, decimal item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (decimal)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDouble

#
void SetDouble(string item_name, double item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (double)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDouble

#
void SetDouble(string item_name, int item_index, double item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (double)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDoubleArray

#
void SetDoubleArray(string item_name, double[] item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (double[])Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDoubleArray

#
void SetDoubleArray(string item_name, int item_index, double[] item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (double[])Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingBitmap

#
void SetDrawingBitmap(string item_name, Bitmap item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (Bitmap)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingBitmap

#
void SetDrawingBitmap(string item_name, int item_index, Bitmap item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (Bitmap)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingColor

#
void SetDrawingColor(string item_name, Color item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (Color)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingColor

#
void SetDrawingColor(string item_name, int item_index, Color item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (Color)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingPoint

#
void SetDrawingPoint(string item_name, int item_index, Point item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (Point)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingPoint

#
void SetDrawingPoint(string item_name, Point item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (Point)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingPointF

#
void SetDrawingPointF(string item_name, int item_index, PointF item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (PointF)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingPointF

#
void SetDrawingPointF(string item_name, PointF item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (PointF)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingRectangle

#
void SetDrawingRectangle(string item_name, int item_index, Rectangle item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (Rectangle)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingRectangle

#
void SetDrawingRectangle(string item_name, Rectangle item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (Rectangle)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingRectangleF

#
void SetDrawingRectangleF(string item_name, int item_index, RectangleF item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (RectangleF)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingRectangleF

#
void SetDrawingRectangleF(string item_name, RectangleF item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (RectangleF)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingSize

#
void SetDrawingSize(string item_name, int item_index, Size item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (Size)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingSize

#
void SetDrawingSize(string item_name, Size item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (Size)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetDrawingSizeF

#
void SetDrawingSizeF(string item_name, int item_index, SizeF item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (SizeF)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetDrawingSizeF

#
void SetDrawingSizeF(string item_name, SizeF item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (SizeF)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetGuid

#
void SetGuid(string item_name, Guid item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (Guid)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetGuid

#
void SetGuid(string item_name, int item_index, Guid item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (Guid)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetInt32

#
void SetInt32(string item_name, int item_index, int item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (int)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetInt32

#
void SetInt32(string item_name, int item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (int)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetInt64

#
void SetInt64(string item_name, int item_index, long item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (long)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetInt64

#
void SetInt64(string item_name, long item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (long)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetInterval1D

#
void SetInterval1D(string item_name, GH_Interval1D item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Interval1D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetInterval1D

#
void SetInterval1D(string item_name, int item_index, GH_Interval1D item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Interval1D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetInterval2D

#
void SetInterval2D(string item_name, GH_Interval2D item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Interval2D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetInterval2D

#
void SetInterval2D(string item_name, int item_index, GH_Interval2D item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Interval2D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetLine

#
void SetLine(string item_name, GH_Line item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Line)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetLine

#
void SetLine(string item_name, int item_index, GH_Line item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Line)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetPath

#
void SetPath(string item_name, int item_index, string absolutePath, string basePath)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
absolutePath (string)Absolute path to store.
basePath (string)Base path. This will be used to also store a relative path.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetPath

#
void SetPath(string item_name, string absolutePath, string basePath)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
absolutePath (string)Absolute path to store.
basePath (string)Base path. This will be used to also store a relative path.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetPlane

#
void SetPlane(string item_name, GH_Plane item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Plane)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetPlane

#
void SetPlane(string item_name, int item_index, GH_Plane item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Plane)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetPoint2D

#
void SetPoint2D(string item_name, GH_Point2D item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Point2D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetPoint2D

#
void SetPoint2D(string item_name, int item_index, GH_Point2D item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Point2D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetPoint3D

#
void SetPoint3D(string item_name, GH_Point3D item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Point3D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetPoint3D

#
void SetPoint3D(string item_name, int item_index, GH_Point3D item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Point3D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetPoint4D

#
void SetPoint4D(string item_name, GH_Point4D item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Point4D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetPoint4D

#
void SetPoint4D(string item_name, int item_index, GH_Point4D item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Point4D)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetSingle

#
void SetSingle(string item_name, float item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (float)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetSingle

#
void SetSingle(string item_name, int item_index, float item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (float)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetString

#
void SetString(string item_name, int item_index, string item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (string)Value of item to add. If a null String is supplied, a zero-length String will be serialized.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetString

#
void SetString(string item_name, string item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (string)Value of item to add. If a null String is supplied, a zero-length String will be serialized.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetVersion

#
void SetVersion(string item_name, GH_Version item_value)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_value (GH_Version)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name already exists.

SetVersion

#
void SetVersion(string item_name, int item_index, GH_Version item_value)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
item_value (GH_Version)Value of item to add.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetVersion

#
void SetVersion(string item_name, int item_index, int major, int minor, int revision)
Add a new data item to this chunk. The combination of name and index must be unique or an exception will be thrown.
item_name (string)Name of item to add.
item_index (int)Index of item to add.
major (int)Major component of version structure.
minor (int)Minor component of version structure.
revision (int)Revision component of version structure.
InvalidOperationExceptionThrown if another item with the same name and index already exists.

SetVersion

#
void SetVersion(string item_name, int major, int minor, int revision)
Add a new data item to this chunk. The name must be unique or an exception will be thrown.
item_name (string)Name of item to add.
major (int)Major component of version structure.
minor (int)Minor component of version structure.
revision (int)Revision component of version structure.
InvalidOperationExceptionThrown if another item with the same name already exists.

Write

void Write(BinaryWriter writer)
Called when an object is required to serialize itself.
inherited fromGH_IBinarySupport
writer (BinaryWriter)Writer object to be used for serialization.

Write

void Write(XmlWriter writer)
Called when an object is required to serialize itself.
inherited fromGH_IXmlSupport
writer (XmlWriter)Writer object to be used for serialization.