GH_ArchiveAppendObject Method |
Appends a target object into the root node of this archive tree.
If the root doesn't exist yet, it will be created. Existing objects at the root scope
will not be affected.
Namespace:
GH_IO.Serialization
Assembly:
GH_IO (in GH_IO.dll)
Syntax public bool AppendObject(
GH_ISerializable target,
string targetName
)
Public Function AppendObject (
target As GH_ISerializable,
targetName As String
) As Boolean
Parameters
- target
- Type: GH_IOGH_ISerializable
Object to append. Cannot be null. - targetName
- Type: SystemString
Name of object to append, name must be unique.
Return Value
Type:
BooleanTrue on succes, false on failure.
Exceptions Examples This sample shows how to create a new archive and serialize a single top level object.
bool CreateFile(string file_name, GH_ISerializable target, string target_name)
{
GH_Archive archive = new GH_Archive();
archive.AppendObject(target, target_name);
return archive.WriteToFile(file_name, true);
}
See Also