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
#~File3dm()
Passively reclaims unmanaged resources when the class user did not explicitly call Dispose().
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.
obsoleteUse the new AllDimStyles property
Dimension Styles in this file.
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.
obsoleteUse the new AllHatchPatterns property
Hatch patterns in this file
obsoleteUse the new AllInstanceDefinitions property
Instance definitions in this file.
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.
obsoleteUse the new AllLayers property
Layers in this file.
obsoleteUse the new AllLinetypes property
Linetypes in this file.
Retrieves the manifest with all object descriptions in this file.
obsoleteUse the new AllMaterials property
Materials in this file.
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
obsoletePolish and Audit functionality no longer exist.
This function is only kept for forward assembly compatibility.
public void Dispose()
Actively reclaims unmanaged resources that this instance uses.
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.
Parameters:
| disposing (bool) | 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.
Parameters:
| log (TextLog) |
Read a 3dm file from a byte array
Parameters:
| bytes (byte[]) |
Returns: New File3dm on success, null on error.
obsoleteIsValid now returns always true.
The File3dm object is kept consistent during its creation. Therefore, this function now returns only true.
Parameters:
| errors (out string) | No errors are found. |
Returns: true in any case.
obsoleteIsValid now returns always true.
The File3dm object is kept consistent during its creation. Therefore, this function now returns only true.
Parameters:
| errors (TextLog) | No errors are found. |
Returns: >true in any case.
public void Polish()
obsoletePolish and Audit functionality no longer exist.
This function is only kept for forward assembly compatibility.
[CLSCompliant(false)]
public static File3dm Read(string path, TableTypeFilter tableTypeFilterFilter, ObjectTypeFilter objectTypeFilter)
Reads a 3dm file from a specified location.
Parameters:
| path (string) | The file to read. |
| tableTypeFilterFilter (File3dm.TableTypeFilter) | If tableTypeFilterFilter is None, then everything in the archive is read. Otherwise tableTypeFilterFilter identifies what tables should be read. |
| objectTypeFilter (File3dm.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.
Parameters:
| path (string) | The file to read. |
Returns: new File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
public static void ReadApplicationData(string path, out string applicationName, out string applicationUrl, out string applicationDetails)
Reads only the application information from an existing 3dm file.
Parameters:
| path (string) | A location on disk or network. |
| applicationName (out string) | The application name. This out parameter is assigned during this call. |
| applicationUrl (out string) | The application URL. This out parameter is assigned during this call. |
| applicationDetails (out string) | The application details. This out parameter is assigned during this call. |
Reads only the archive 3dm version from an existing 3dm file.
Parameters:
| path (string) | The file from which to read the archive version. |
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.
Parameters:
| path (string) | The location of the 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
Parameters:
| path (string) | A location on disk or network. |
Returns: The earth anchor point.
Reads only the notes from an existing 3dm file.
Parameters:
| path (string) | The file from which to read the notes. |
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.
Parameters:
| path (string) | A location on disk or network. |
Returns: An array of view information if successful, otherwise an empty array.
Attempts to read the preview image out of a 3dm file.
Parameters:
| path (string) | The location of the file. |
Returns: A bitmap, or null on failure.
Exceptions:
| FileNotFoundException | If the provided path is null, does not exist or cannot be accessed. |
public static bool ReadRevisionHistory(string path, out string createdBy, out string lastEditedBy, out int revision, out DateTime createdOn, out DateTime lastEditedOn)
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
Parameters:
| path (string) | path to the 3dm file |
| createdBy (out string) | original author of the file |
| lastEditedBy (out string) | last person to edit the file |
| revision (out int) | which revision this file is at |
| createdOn (out DateTime) | date file was created (DateTime.MinValue if not set in file) |
| lastEditedOn (out DateTime) | 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.
Parameters:
| path (string) | The file to 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.
Parameters:
| path (string) | The file to read. |
| errorLog (out string) | Any archive reading errors are logged here. |
Returns: New File3dm on success, null on error.
Exceptions:
| FileNotFoundException | If path does not exist. |
[CLSCompliant(false)]
public static File3dm ReadWithLog(string path, TableTypeFilter tableTypeFilterFilter, ObjectTypeFilter objectTypeFilter, out string errorLog)
Reads a 3dm file from a specified location.
Parameters:
| path (string) | The file to read. |
| tableTypeFilterFilter (File3dm.TableTypeFilter) | If tableTypeFilterFilter is None, then everything in the archive is read. Otherwise tableTypeFilterFilter identifies what tables should be read. |
| objectTypeFilter (File3dm.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. |
| errorLog (out string) | 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
Parameters:
| image (Bitmap) |
Write to an in-memory byte[]
Parameters:
| options (File3dmWriteOptions) |
Writes contents of this model to an openNURBS archive. If the model is not valid, then Write will refuse to write it.
Parameters:
| path (string) | The file name to use for writing. |
| options (File3dmWriteOptions) | 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.
Parameters:
| path (string) | The file name to use for writing. |
| version (int) | 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.
Parameters:
| path (string) | Path to the 3dm file to create. |
| geometry (IEnumerable<GeometryBase>) | 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.
Parameters:
| path (string) | Path to the 3dm file to create. |
| geometry (GeometryBase) | 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.
Parameters:
| path (string) | The file name to use for writing. |
| options (File3dmWriteOptions) | An options instance, or null for default. |
| errorLog (out string) | This argument will be filled by out reference. |
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.
Parameters:
| path (string) | The file name to use for writing. |
| version (int) | 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. |
| errorLog (out string) | This argument will be filled by out reference. |
Returns: true if archive is written with no error. false if errors occur.