BinaryArchiveReader

References
public class BinaryArchiveReader
Represents an entity that is capable of reading a binary archive and instantiating strongly-typed objects.

Properties

Archive3dmVersion

#Since v5.0
public int Archive3dmVersion { get; }
If a 3dm archive is being read or written, then this is the version of the 3dm archive format (1, 2, 3, 4 or 5). 0 a 3dm archive is not being read/written 1 a version 1 3dm archive is being read/written 2 a version 2 3dm archive is being read/written 3 a version 3 3dm archive is being read/written 4 a version 4 3dm archive is being read/written 5 an old version 5 3dm archive is being read 50 a version 5 3dm archive is being read/written.

CurrentPosition

#Since v6.0
[CLSCompliant(false)] public ulong CurrentPosition { get; }
current offset (in bytes) into archive ( like ftell() )

ReadErrorOccured

#Since v5.0
public bool ReadErrorOccured { get; set; }
Gets or sets whether en error occurred during reading.

Methods

AtEnd

#Since v5.1
public bool AtEnd()
true if at end of a file

BeginRead3dmChunk

#
[CLSCompliant(false)] public bool BeginRead3dmChunk(out uint typeCode, out long value)
Begins reading a chunk that must be in the archive at this location.
typeCode (out uint)
value (out long)

BeginRead3dmChunk

#Since v6.0
[CLSCompliant(false)] public bool BeginRead3dmChunk(uint expectedTypeCode, out int majorVersion, out int minorVersion)
Begins reading a chunk that must be in the archive at this location.
expectedTypeCode (uint)
majorVersion (out int)
minorVersion (out int)
True if beginning of the chunk was read. In this case you must call EndRead3dmChunk(), even if something goes wrong while you attempt to read the interior of the chunk. False if the chunk did not exist at the current location in the file.

Dump3dmChunk

#Since v5.1
[CLSCompliant(false)] public uint Dump3dmChunk(TextLog log, int recursionLimit)
Function for studying contents of a file. The primary use is as an aid to help dig through files that have been damaged (bad disks, transmission errors, etc.) If an error is found, a line that begins with the word "ERROR" is printed.
log (TextLog)log where information is printed to
recursionLimit (int)Subchunk depth to report to. Pass -1 for no limit
0 if something went wrong, otherwise the typecode of the chunk that was just studied.

Dump3dmChunk

#Since v5.1
[CLSCompliant(false)] public uint Dump3dmChunk(TextLog log)
Function for studying contents of a file. The primary use is as an aid to help dig through files that have been damaged (bad disks, transmission errors, etc.) If an error is found, a line that begins with the word "ERROR" is printed.
log (TextLog)log where information is printed to
0 if something went wrong, otherwise the typecode of the chunk that was just studied.

EnableCRCCalculation

#Since v6.0
public bool EnableCRCCalculation(bool enable)
Expert user function to control CRC calculation while reading and writing. Typically this is used when seeking around and reading/writing information in non-serial order.
enable (bool)
Current state of CRC calculation. Use the returned value to restore the CRC calculation setting after you are finished doing your fancy pants expert IO.

EndRead3dmChunk

#Since v6.0
public bool EndRead3dmChunk(bool suppressPartiallyReadChunkWarning)
Calling this will skip rest of stuff in chunk if it was only partially read.
suppressPartiallyReadChunkWarning (bool)Generally, a call to ON_WARNING is made when a chunk is partially read. If suppressPartiallyReadChunkWarning is true, then no warning is issued for partially read chunks.

Read3dmChunkVersion

#Since v5.0
public void Read3dmChunkVersion(out int major, out int minor)
A chunk version is a single byte that encodes a major.minor version number. Useful when creating I/O code for 3dm chunks that may change in the future. Increment the minor version number if new information is added to the end of the chunk. Increment the major version if the format of the chunk changes in some other way.
major (out int)0 to 15.
minor (out int)0 to 16.
true on successful read.

Read3dmStartSection

#Since v5.1
public bool Read3dmStartSection(out int version, out string comment)
version (out int).3dm file version (2, 3, 4, 5 or 50)
comment (out string)String with application name, et cetera. This information is primarily used when debugging files that contain problems. McNeel and Associates stores application name, application version, compile date, and the OS in use when file was written.
true on success

ReadBool

#Since v5.0
public bool ReadBool()
Reads a bool from the archive.
The value that was read.

ReadBoolArray

#Since v5.0
public bool[] ReadBoolArray()
Reads an array of bool from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadBoundingBox

#Since v5.0
public BoundingBox ReadBoundingBox()
Reads a BoundingBox from the archive.
The element that was read.

ReadByte

#Since v5.0
public byte ReadByte()
Reads a byte from the archive.
The value that was read.

ReadByteArray

#Since v5.0
public byte[] ReadByteArray()
Reads an array of byte from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadCheckSum

#Since v6.0 Obsolete v6.0
[EditorBrowsable(EditorBrowsableState.Never)] public void ReadCheckSum()
obsoleteThis is only present to allow reading of old ON_CheckSum data
Reads a legacy ON_CheckSum, only provided to read data chunks from old V5 files, the CheckSum read is discarded

ReadColor

#Since v5.0
public Color ReadColor()
Reads a Color from the archive.
The element that was read.

ReadCompressedBuffer

#Since v5.9
public byte[] ReadCompressedBuffer()
Reads an array of compressed byte information from the archive and uncompresses it.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadDictionary

#Since v5.0
public ArchivableDictionary ReadDictionary()
Reads a complete ArchivableDictionary from the archive.
The newly instantiated object.

ReadDouble

#Since v5.0
public double ReadDouble()
Reads a double from the archive.
The value that was read.

ReadDoubleArray

#Since v5.0
public double[] ReadDoubleArray()
Reads an array of double from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadFont

#Since v5.0
public Font ReadFont()
Reads a Font from the archive.
The element that was read.

ReadGeometry

#Since v5.0
public GeometryBase ReadGeometry()
Reads a GeometryBase-derived object from the archive.

The GeometryBase class is abstract.

The element that was read.

ReadGeometryArray

#Since v7.0
public GeometryBase[] ReadGeometryArray()

ReadGuid

#Since v5.0
public Guid ReadGuid()
Reads a Guid from the archive.
The value that was read.

ReadGuidArray

#Since v5.0
public Guid[] ReadGuidArray()
Reads an array of Guid from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadInt

#Since v5.0
public int ReadInt()
Reads a int from the archive.
The value that was read.

ReadInt64

#Since v5.0
public long ReadInt64()
Reads a long from the archive.
The value that was read.

ReadIntArray

#Since v5.0
public int[] ReadIntArray()
Reads an array of int from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadInterval

#Since v5.0
public Interval ReadInterval()
Reads a Interval from the archive.
The element that was read.

ReadLine

#Since v5.0
public Line ReadLine()
Reads a Line from the archive.
The element that was read.

ReadMeshingParameters

#Since v5.0
public MeshingParameters ReadMeshingParameters()
Reads a MeshingParameters from the archive.
The element that was read.

ReadObjRef

#Since v5.8
public ObjRef ReadObjRef()
Reads a ObjRef from the archive
the element that was read

ReadObjRefArray

#Since v5.8
public ObjRef[] ReadObjRefArray()
Reads an array of double from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadPlane

#Since v5.0
public Plane ReadPlane()
Reads a Plane from the archive.
The element that was read.

ReadPoint

#Since v5.0
public Point ReadPoint()
Reads a Point from the archive.
The element that was read.

ReadPoint2d

#Since v5.0
public Point2d ReadPoint2d()
Reads a Point2d from the archive.
The element that was read.

ReadPoint3d

#Since v5.0
public Point3d ReadPoint3d()
Reads a Point3d from the archive.
The element that was read.

ReadPoint3f

#Since v5.0
public Point3f ReadPoint3f()
Reads a Point3f from the archive.
The element that was read.

ReadPoint4d

#Since v5.0
public Point4d ReadPoint4d()
Reads a Point4d from the archive.
The element that was read.

ReadPointF

#Since v5.0
public PointF ReadPointF()
Reads a PointF from the archive.
The element that was read.

ReadRay3d

#Since v5.0
public Ray3d ReadRay3d()
Reads a Ray3d from the archive.
The element that was read.

ReadRectangle

#Since v5.0
public Rectangle ReadRectangle()
Reads a Rectangle from the archive.
The element that was read.

ReadRectangleF

#Since v5.0
public RectangleF ReadRectangleF()
Reads a RectangleF from the archive.
The element that was read.

ReadRenderSettings

#Since v6.0
public RenderSettings ReadRenderSettings()
Reads a RenderSettings-derived object from the archive.
The element that was read.

ReadSByte

#Since v5.0
[CLSCompliant(false)] public sbyte ReadSByte()
Reads a sbyte from the archive.
The value that was read.

ReadSByteArray

#Since v5.0
[CLSCompliant(false)] public sbyte[] ReadSByteArray()
Reads an array of sbyte from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadShort

#Since v5.0
public short ReadShort()
Reads a short from the archive.
The value that was read.

ReadShortArray

#Since v5.0
public short[] ReadShortArray()
Reads an array of short from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadSingle

#Since v5.0
public float ReadSingle()
Reads a float from the archive.
The value that was read.

ReadSingleArray

#Since v5.0
public float[] ReadSingleArray()
Reads an array of float from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadSize

#Since v5.0
public Size ReadSize()
Reads a Size from the archive.
The element that was read.

ReadSizeF

#Since v5.0
public SizeF ReadSizeF()
Reads a SizeF from the archive.
The element that was read.

ReadString

#Since v5.0
public string ReadString()
Reads a string from the archive.
The value that was read.

ReadStringArray

#Since v5.0
public string[] ReadStringArray()
Reads an array of string from the archive.

An array is returned even if the input was another enumerable type.

The array that was read.

ReadTransform

#Since v5.0
public Transform ReadTransform()
Reads a Transform from the archive.
The element that was read.

ReadUInt

#Since v5.0
[CLSCompliant(false)] public uint ReadUInt()
Reads a uint from the archive.
The value that was read.

ReadUShort

#Since v5.0
[CLSCompliant(false)] public ushort ReadUShort()
Reads a ushort from the archive.
The value that was read.

ReadUtf8String

#Since v6.0
public string ReadUtf8String()
Reads a string from the archive.
The value that was read.

ReadVector2d

#Since v5.0
public Vector2d ReadVector2d()
Reads a Vector2d from the archive.
The element that was read.

ReadVector3d

#Since v5.0
public Vector3d ReadVector3d()
Reads a Vector3d from the archive.
The element that was read.

ReadVector3f

#Since v5.0
public Vector3f ReadVector3f()
Reads a Vector3f from the archive.
The element that was read.

SeekFromCurrentPosition

#
public bool SeekFromCurrentPosition(long byteOffset)
seek from current position ( like fseek( ,SEEK_CUR) )
byteOffset (long)

SeekFromCurrentPosition

#
[CLSCompliant(false)] public bool SeekFromCurrentPosition(ulong byteOffset, bool forward)
seek from current position ( like fseek( ,SEEK_CUR) )
byteOffset (ulong)
forward (bool)seek forward of backward in the archive

SeekFromStart

#
[CLSCompliant(false)] public bool SeekFromStart(ulong byteOffset)
seek from start position ( like fseek( ,SEEK_SET) )
byteOffset (ulong)