File3dm
ReferencesRepresents 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
Finalizer
~File3dm
#Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
~File3dm()
Properties
Dimension Styles in this file.
Hatch patterns in this file.
Instance definitions in this file
Named construction planes in this file.
Views that represent the RhinoViews which are displayed when Rhino loads this file.
Gets or sets details for the application that wrote this file.
Gets or sets the name of the application that wrote this file.
Gets or sets a URL for the application that wrote this file.
Get the DateTime that this file was originally created. If the value is not set in the 3dm file, then DateTime.MinValue is returned
Gets a string that names the user who created the file.
Dimension Styles in this file.
obsoleteUse the new AllDimStyles property
If set, this is the model's location on the earth. This information is used when the model is used with GIS information.
The embedded files in this file.
Hatch patterns in this file
obsoleteUse the new AllHatchPatterns property
Instance definitions in this file.
obsoleteUse the new AllInstanceDefinitions property
Get the DateTime that this file was last edited. If the value is not set in the 3dm file, then DateTime.MinValue is returned
Gets a string that names the user who last edited the file.
Layers in this file.
obsoleteUse the new AllLayers property
Linetypes in this file.
obsoleteUse the new AllLinetypes property
Retrieves the manifest with all object descriptions in this file.
Materials in this file.
obsoleteUse the new AllMaterials property
Named construction planes in this file.
Gets access to the File3dmObjectTable class associated with this file, which contains all objects.
Custom plug-in data in this file. This data is not attached to any geometry or attributes
The render environments in this file.
The render materials in this file.
The render textures in this file.
Settings include tolerance, and unit system, and defaults used for creating views and objects.
Gets or sets the start section comments, which are the comments with which the 3dm file begins.
Methods
This function is only kept for forward assembly compatibility.
obsoletePolish and Audit functionality no longer exist.
Returns: Returns 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.
Prepares a text dump of model properties and settings.
Returns: The text dump.
Prepares a text dump of the entire model.
Read a 3dm file from a byte array
Returns: New File3dm on success, null on error.
The File3dm object is kept consistent during its creation. Therefore, this function now returns only true.
obsoleteIsValid now returns always true.
Returns: true in any case.
The File3dm object is kept consistent during its creation. Therefore, this function now returns only true.
obsoleteIsValid now returns always true.
Returns: >true in any case.
This function is only kept for forward assembly compatibility.
public void Polish()
obsoletePolish and Audit functionality no longer exist.
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.
Returns: new File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
Reads a 3dm file from a specified location.
Returns: new File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
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.
Reads only the archive 3dm version from an existing 3dm file.
Returns: The 3dm file archive version.
Exceptions:
| FileNotFoundException | If path does not exist, is null or cannot be accessed because of permissions. |
Read the dimension styles table out of a 3dm file.
Returns: Array of dimension styles on success (empty array if file does not contain dimension styles) null on error
Exceptions:
| FileNotFoundException | If the provided path is null, does not exist or cannot be accessed. |
Reads only the earth anchor point from an existing 3dm file
Returns: The earth anchor point.
Reads only the notes from an existing 3dm file.
Returns: The 3dm file notes.
Exceptions:
| FileNotFoundException | If path does not exist, is null or cannot be accessed because of permissions. |
Reads page view, or layout, information from an existing 3dm file.
Returns: An array of view information if successful, otherwise an empty array.
Attempts to read the preview image out of a 3dm file.
Returns: A bitmap, or null on failure.
Exceptions:
| FileNotFoundException | If the provided path is null, does not exist or cannot be accessed. |
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
out DateTime
createdOn,
date file was created (DateTime.MinValue if not set in file)
out DateTime
lastEditedOn
date file was last edited (DateTime.MinValue if not set in file)
Returns: true on success
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.
Returns: new File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
Read a 3dm file from a specified location and log any archive reading errors.
Returns: New File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
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.
Returns: new File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
Preview image used for file explorer
Write to an in-memory byte[]
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.
Returns: true if archive is written with no error. false if errors occur.
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.
Returns: true if archive is written with no error. false if errors occur.
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.
Returns: True if successful, false otherwise.
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.
Returns: True if successful, false otherwise.
Writes contents of this model to an openNURBS archive. If the model is not valid, then Write will refuse to write it.
Returns: true if archive is written with no error. false if errors occur.
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.
Returns: true if archive is written with no error. false if errors occur.