Model

class py3dm.Model

Python bindings for the openNURBS ONX_Model class.

ONX_Model: pedagogical example of all the things in an OpenNURBS 3dm archive. The openNURBS examples use ONX_Model to store the information read from 3dm archives.

property application_details: str
property application_name: str
property application_url: str
property archive_version: int
property created_by: str
property curve_table: CurveTable
property layer_table: LayerTable
property last_edited_by: str
property point_table: PointTable
property revision: int
new_revision() int

Returns the updated revision count.

Notes

If the current revision is set to 0, ON_3dmRevisionHistory is set to empty, overriding the current settings. Refer to ../tests/test_model.py to understand the proper setup order.

read(path_to_file: str) bool

Reads an openNURBS archive and loads the information in this model. Before trying to read the 3dm file, the current model is reset!

Parameters:

path_to_file (str) – Path to 3dm file, including file name and extension.

Returns:

successTrue if the archive is read without error, False otherwise.

Return type:

bool

reset() None

Resets the current model.

write(path_to_file: str, version: int = 7) bool

Writes the content of this model to an openNURBS archive.

Parameters:
  • path_to_file (str) – Path to 3dm file, including file name and extension.

  • version (int, optional default to 7) – Rhinoceros major varsion.

Returns:

successTrue if the archive is written without errors, False otherwise.

Return type:

bool