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
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.
public int Archive3dmVersion { get; }

CurrentPosition

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

ReadErrorOccured

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

Methods

AtEnd

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

BeginRead3dmChunk

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

BeginRead3dmChunk

#Since v6.0
Begins reading a chunk that must be in the archive at this location.
[CLSCompliant(false)] public bool BeginRead3dmChunk(
expectedTypeCode,
out int
majorVersion,
out int
minorVersion
)
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
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.
[CLSCompliant(false)] public uint Dump3dmChunk(
log,
log where information is printed to
recursionLimit
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
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.
[CLSCompliant(false)] public uint Dump3dmChunk(
log
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
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.
public bool EnableCRCCalculation(
enable
)
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
Calling this will skip rest of stuff in chunk if it was only partially read.
public bool EndRead3dmChunk(
suppressPartiallyReadChunkWarning
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
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.
public void Read3dmChunkVersion(
out int
major,
0 to 15.
out int
minor
0 to 16.
)
true on successful read.

Read3dmStartSection

#Since v5.1
public bool Read3dmStartSection(
out int
version,
.3dm file version (2, 3, 4, 5 or 50)
out string
comment
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
Reads a bool from the archive.
public bool ReadBool()
The value that was read.

ReadBoolArray

#Since v5.0
Reads an array of bool from the archive.

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

public bool[] ReadBoolArray()
The array that was read.

ReadBoundingBox

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

ReadByte

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

ReadByteArray

#Since v5.0
Reads an array of byte from the archive.

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

public byte[] ReadByteArray()
The array that was read.

ReadCheckSum

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

ReadColor

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

ReadCompressedBuffer

#Since v5.9
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.

public byte[] ReadCompressedBuffer()
The array that was read.

ReadDictionary

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

ReadDouble

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

ReadDoubleArray

#Since v5.0
Reads an array of double from the archive.

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

public double[] ReadDoubleArray()
The array that was read.

ReadFont

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

ReadGeometry

#Since v5.0
Reads a GeometryBase-derived object from the archive.

The GeometryBase class is abstract.

public GeometryBase ReadGeometry()
The element that was read.

ReadGeometryArray

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

ReadGuid

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

ReadGuidArray

#Since v5.0
Reads an array of Guid from the archive.

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

public Guid[] ReadGuidArray()
The array that was read.

ReadInt

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

ReadInt64

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

ReadIntArray

#Since v5.0
Reads an array of int from the archive.

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

public int[] ReadIntArray()
The array that was read.

ReadInterval

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

ReadLine

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

ReadMeshingParameters

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

ReadObjRef

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

ReadObjRefArray

#Since v5.8
Reads an array of double from the archive.

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

public ObjRef[] ReadObjRefArray()
The array that was read.

ReadPlane

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

ReadPoint

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

ReadPoint2d

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

ReadPoint3d

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

ReadPoint3f

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

ReadPoint4d

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

ReadPointF

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

ReadRay3d

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

ReadRectangle

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

ReadRectangleF

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

ReadRenderSettings

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

ReadSByte

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

ReadSByteArray

#Since v5.0
Reads an array of sbyte from the archive.

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

[CLSCompliant(false)] public sbyte[] ReadSByteArray()
The array that was read.

ReadShort

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

ReadShortArray

#Since v5.0
Reads an array of short from the archive.

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

public short[] ReadShortArray()
The array that was read.

ReadSingle

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

ReadSingleArray

#Since v5.0
Reads an array of float from the archive.

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

public float[] ReadSingleArray()
The array that was read.

ReadSize

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

ReadSizeF

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

ReadString

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

ReadStringArray

#Since v5.0
Reads an array of string from the archive.

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

public string[] ReadStringArray()
The array that was read.

ReadTransform

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

ReadUInt

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

ReadUShort

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

ReadUtf8String

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

ReadVector2d

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

ReadVector3d

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

ReadVector3f

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

SeekFromCurrentPosition

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

SeekFromCurrentPosition

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

SeekFromStart

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