File3dm

References
public class File3dm : IDisposable
Represents a 3dm file, which is stored using the OpenNURBS file standard.

The 3dm format is the main Rhinoceros storage format.

Visit http://www.opennurbs.com/ for more details.

Constructors

File3dm

#Since v5.0
Initializes a new instance of a 3dm file.
public File3dm()

Finalizer

~File3dm

#
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
~File3dm()

Properties

AllDimStyles

#Since v6.0
Dimension Styles in this file.
public File3dmDimStyleTable AllDimStyles { get; }

AllGroups

#Since v6.5
Groups in this file.
public File3dmGroupTable AllGroups { get; }

AllHatchPatterns

#Since v6.0
Hatch patterns in this file.
public File3dmHatchPatternTable AllHatchPatterns { get; }

AllInstanceDefinitions

#Since v6.0
Instance definitions in this file
public File3dmInstanceDefinitionTable AllInstanceDefinitions { get; }

AllLayers

#Since v6.0
Layers in this file.
public File3dmLayerTable AllLayers { get; }

AllLinetypes

#Since v6.0
Linetypes in this file.
public File3dmLinetypeTable AllLinetypes { get; }

AllMaterials

#Since v6.0
Materials in this file.
public File3dmMaterialTable AllMaterials { get; }

AllNamedConstructionPlanes

#Since v6.0
Named construction planes in this file.
public File3dmNamedConstructionPlanes AllNamedConstructionPlanes { get; }

AllNamedViews

#Since v6.0
Named views in this file.
public File3dmViewTable AllNamedViews { get; }

AllViews

#Since v6.0
Views that represent the RhinoViews which are displayed when Rhino loads this file.
public File3dmViewTable AllViews { get; }

ApplicationDetails

#Since v5.0
Gets or sets details for the application that wrote this file.
public string ApplicationDetails { get; set; }

ApplicationName

#Since v5.0
Gets or sets the name of the application that wrote this file.
public string ApplicationName { get; set; }

ApplicationUrl

#Since v5.0
Gets or sets a URL for the application that wrote this file.
public string ApplicationUrl { get; set; }

ArchiveVersion

#Since v7.9
Gets the 3dm file archive version.
public int ArchiveVersion { get; }

Created

#Since v5.6
Get the DateTime that this file was originally created. If the value is not set in the 3dm file, then DateTime.MinValue is returned
public DateTime Created { get; }

CreatedBy

#Since v5.0
Gets a string that names the user who created the file.
public string CreatedBy { get; }

DimStyles

#Since v5.0
Dimension Styles in this file.
public IList<DimensionStyle> DimStyles { get; }
obsoleteUse the new AllDimStyles property

EarthAnchorPoint

#Since v8.3
If set, this is the model's location on the earth. This information is used when the model is used with GIS information.
public EarthAnchorPoint EarthAnchorPoint { get; set; }

EmbeddedFiles

#Since v8.0
The embedded files in this file.
public File3dmEmbeddedFiles EmbeddedFiles { get; }

HatchPatterns

#Since v5.0
Hatch patterns in this file
public IList<HatchPattern> HatchPatterns { get; }
obsoleteUse the new AllHatchPatterns property

InstanceDefinitions

#Since v5.6
Instance definitions in this file.
public IList<InstanceDefinitionGeometry> InstanceDefinitions { get; }
obsoleteUse the new AllInstanceDefinitions property

LastEdited

#Since v5.6
Get the DateTime that this file was last edited. If the value is not set in the 3dm file, then DateTime.MinValue is returned
public DateTime LastEdited { get; }

LastEditedBy

#Since v5.0
Gets a string that names the user who last edited the file.
public string LastEditedBy { get; }

Layers

#Since v5.0
Layers in this file.
public IList<Layer> Layers { get; }
obsoleteUse the new AllLayers property

Linetypes

#Since v5.0
Linetypes in this file.
public IList<Linetype> Linetypes { get; }
obsoleteUse the new AllLinetypes property

Manifest

#Since v6.0
Retrieves the manifest with all object descriptions in this file.
public ManifestTable Manifest { get; }

Materials

#Since v5.0
Materials in this file.
public IList<Material> Materials { get; }
obsoleteUse the new AllMaterials property

NamedConstructionPlanes

#Since v6.0
Named construction planes in this file.
public IList<ConstructionPlane> NamedConstructionPlanes { get; }

NamedViews

#Since v5.0
Named views in this file.
public IList<ViewInfo> NamedViews { get; }

Notes

#Since v5.0
Gets or sets the model notes.
public File3dmNotes Notes { get; set; }

Objects

#Since v5.0
Gets access to the File3dmObjectTable class associated with this file, which contains all objects.
public File3dmObjectTable Objects { get; }

PlugInData

#Since v5.0
Custom plug-in data in this file. This data is not attached to any geometry or attributes
public File3dmPlugInDataTable PlugInData { get; }

RenderEnvironments

#Since v8.0
The render environments in this file.
public File3dmRenderEnvironments RenderEnvironments { get; }

RenderMaterials

#Since v8.0
The render materials in this file.
public File3dmRenderMaterials RenderMaterials { get; }

RenderTextures

#Since v8.0
The render textures in this file.
public File3dmRenderTextures RenderTextures { get; }

Revision

#Since v5.0
Gets or sets the revision number.
public int Revision { get; set; }

Settings

#Since v5.0
Settings include tolerance, and unit system, and defaults used for creating views and objects.
public File3dmSettings Settings { get; }

StartSectionComments

#Since v5.0
Gets or sets the start section comments, which are the comments with which the 3dm file begins.
public string StartSectionComments { get; set; }

Strings

#Since v6.0
Document user strings in this file
public File3dmStringTable Strings { get; }

Views

#Since v5.0
Views that represent the RhinoViews which are displayed when Rhino loads this file.
public IList<ViewInfo> Views { get; }

Methods

Audit

#Since v5.0 Obsolete v6.0
This function is only kept for forward assembly compatibility.
public int Audit(
attemptRepair,
Ignored.
out int
repairCount,
Is set to 0.
out string
errors,
Contains no meaningful error.
out int[]
warnings
Is set to null.
)
obsoletePolish and Audit functionality no longer exist.
Returns 0.

Dispose

#Since v5.0
Actively reclaims unmanaged resources that this instance uses.
public void Dispose()

Dispose

#
For derived class implementers.

This method is called with argument true when class user calls Dispose(), while with argument false when the Garbage Collector invokes the finalizer, or Finalize() method.

You must reclaim all used unmanaged resources in both cases, and can use this chance to call Dispose on disposable fields if the argument is true.

Also, you must call the base virtual method within your overriding method.

protected virtual void Dispose(
disposing
true if the call comes from the Dispose() method; false if it comes from the Garbage Collector finalizer.
)

Dump

#Since v5.0
Prepares a text dump of the entire model.
public string Dump()
The text dump.

DumpSummary

#Since v5.0
Prepares a text dump of model properties and settings.
public string DumpSummary()
The text dump.

DumpToTextLog

#Since v5.1
Prepares a text dump of the entire model.
public void DumpToTextLog()

FromByteArray

#Since v7.0
Read a 3dm file from a byte array
public static File3dm FromByteArray(
byte[]
bytes
)
New File3dm on success, null on error.

GetPreviewImage

#Since v6.0
Preview image used for file explorer
public Bitmap GetPreviewImage()

IsValid

#Since v5.0 Obsolete v6.0
The File3dm object is kept consistent during its creation. Therefore, this function now returns only true.
public bool IsValid(
out string
errors
No errors are found.
)
obsoleteIsValid now returns always true.
true in any case.

IsValid

#Since v5.1 Obsolete v6.0
The File3dm object is kept consistent during its creation. Therefore, this function now returns only true.
public bool IsValid(
errors
No errors are found.
)
obsoleteIsValid now returns always true.
>true in any case.

Polish

#Since v5.0 Obsolete v6.0
This function is only kept for forward assembly compatibility.
public void Polish()
obsoletePolish and Audit functionality no longer exist.

Read

#Since v5.9
Reads a 3dm file from a specified location.
[CLSCompliant(false)] public static File3dm Read(
path,
The file to read.
tableTypeFilterFilter,
If tableTypeFilterFilter is None, then everything in the archive is read. Otherwise tableTypeFilterFilter identifies what tables should be read.
objectTypeFilter
If objectTypeFilter is not None, then is a filter made by bitwise or-ing values to select which types of objects will be read from the model object table.
)
new File3dm on success, null on error.
FileNotFoundExceptionIf path does not exist.

Read

#Since v5.0
Reads a 3dm file from a specified location.
public static File3dm Read(
path
The file to read.
)
new File3dm on success, null on error.
FileNotFoundExceptionIf path does not exist.

ReadApplicationData

#Since v5.0
Reads only the application information from an existing 3dm file.
public static void ReadApplicationData(
path,
A location on disk or network.
out string
applicationName,
The application name. This out parameter is assigned during this call.
out string
applicationUrl,
The application URL. This out parameter is assigned during this call.
out string
applicationDetails
The application details. This out parameter is assigned during this call.
)

ReadArchiveVersion

#Since v5.10
Reads only the archive 3dm version from an existing 3dm file.
public static int ReadArchiveVersion(
path
The file from which to read the archive version.
)
The 3dm file archive version.
FileNotFoundExceptionIf path does not exist, is null or cannot be accessed because of permissions.

ReadDimensionStyles

#Since v6.0
Read the dimension styles table out of a 3dm file.
public static DimensionStyle[] ReadDimensionStyles(
path
The location of the file.
)
Array of dimension styles on success (empty array if file does not contain dimension styles) null on error
FileNotFoundExceptionIf the provided path is null, does not exist or cannot be accessed.

ReadEarthAnchorPoint

#Since v8.3
Reads only the earth anchor point from an existing 3dm file
public static EarthAnchorPoint ReadEarthAnchorPoint(
path
A location on disk or network.
)
The earth anchor point.

ReadNotes

#Since v5.0
Reads only the notes from an existing 3dm file.
public static string ReadNotes(
path
The file from which to read the notes.
)
The 3dm file notes.
FileNotFoundExceptionIf path does not exist, is null or cannot be accessed because of permissions.

ReadPageViews

#Since v9.0
Reads page view, or layout, information from an existing 3dm file.
public static ViewInfo[] ReadPageViews(
path
A location on disk or network.
)
An array of view information if successful, otherwise an empty array.

ReadPreviewImage

#Since v5.0
Attempts to read the preview image out of a 3dm file.
public static Bitmap ReadPreviewImage(
path
The location of the file.
)
A bitmap, or null on failure.
FileNotFoundExceptionIf the provided path is null, does not exist or cannot be accessed.

ReadRevisionHistory

#Since v5.6
Quickly check a file for it's revision information. This function does not read the entire file, just what it needs to get revision information out
public static bool ReadRevisionHistory(
path,
path to the 3dm file
out string
createdBy,
original author of the file
out string
lastEditedBy,
last person to edit the file
out int
revision,
which revision this file is at
createdOn,
date file was created (DateTime.MinValue if not set in file)
lastEditedOn
date file was last edited (DateTime.MinValue if not set in file)
)
true on success

ReadSettings

#Since v9.0
Reads only the start section, properties, and settings from a 3dm file at a specified location. The rest of the model (objects, layers, and other tables) is not read.
public static File3dm ReadSettings(
path
The file to read.
)
new File3dm on success, null on error.
FileNotFoundExceptionIf path does not exist.

ReadWithLog

#Since v5.0
Read a 3dm file from a specified location and log any archive reading errors.
public static File3dm ReadWithLog(
path,
The file to read.
out string
errorLog
Any archive reading errors are logged here.
)
New File3dm on success, null on error.
FileNotFoundExceptionIf path does not exist.

ReadWithLog

#Since v5.9
Reads a 3dm file from a specified location.
[CLSCompliant(false)] public static File3dm ReadWithLog(
path,
The file to read.
tableTypeFilterFilter,
If tableTypeFilterFilter is None, then everything in the archive is read. Otherwise tableTypeFilterFilter identifies what tables should be read.
objectTypeFilter,
If objectTypeFilter is not None, then is a filter made by bitwise or-ing values to select which types of objects will be read from the model object table.
out string
errorLog
Any archive reading errors are logged here.
)
new File3dm on success, null on error.
FileNotFoundExceptionIf path does not exist.

SetPreviewImage

#Since v6.0
Preview image used for file explorer
public void SetPreviewImage(
image
)

ToByteArray

#Since v7.1
Write to an in-memory byte[]
public byte[] ToByteArray()

ToByteArray

#Since v7.1
Write to an in-memory byte[]
public byte[] ToByteArray()

Write

#Since v5.9
Writes contents of this model to an openNURBS archive. If the model is not valid, then Write will refuse to write it.
public bool Write(
path,
The file name to use for writing.
options
An options instance, or null for default.
)
true if archive is written with no error. false if errors occur.

Write

#Since v5.0
Writes contents of this model to an openNURBS archive. If the model is not valid, then Write will refuse to write it.
public bool Write(
path,
The file name to use for writing.
version
Version of the openNURBS archive to write. Must be [2; current version]. Rhino can read its current version, plus earlier file versions except 1. Use latest version when possible.

Alternatively, 0 is a placeholder for the last valid version.

)
true if archive is written with no error. false if errors occur.

WriteMultipleObjects

#Since v7.0
Creates a simple 3dm file that contains a multiple geometric objects.
public static bool WriteMultipleObjects(
path,
Path to the 3dm file to create.
geometry
The geometry to be saved in the archive's object table. This is typically some Curves, Surfaces, Breps, Meshs, or SubDs.
)
True if successful, false otherwise.

WriteOneObject

#Since v7.0
Creates a simple 3dm file that contains a single geometric object.
public static bool WriteOneObject(
path,
Path to the 3dm file to create.
geometry
The geometry to be saved in the archive's object table. This is typically a Curve, Surface, Brep, Mesh, or SubD.
)
True if successful, false otherwise.

WriteWithLog

#Since v6.0
Writes contents of this model to an openNURBS archive. If the model is not valid, then Write will refuse to write it.
public bool WriteWithLog(
path,
The file name to use for writing.
options,
An options instance, or null for default.
out string
errorLog
This argument will be filled by out reference.
)
true if archive is written with no error. false if errors occur.

WriteWithLog

#Since v5.0
Writes contents of this model to an openNURBS archive. If the model is not valid, then Write will refuse to write it.
public bool WriteWithLog(
path,
The file name to use for writing.
version,
Version of the openNURBS archive to write. Must be [2; current version]. Rhino can read its current version, plus earlier file versions except 1. Use latest version when possible.

Alternatively, 0 is a placeholder for the last valid version.

out string
errorLog
This argument will be filled by out reference.
)
true if archive is written with no error. false if errors occur.