Model ===== .. py: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. .. py:property:: application_details :type: str .. py:property:: application_name :type: str .. py:property:: application_url :type: str .. py:property:: archive_version :type: int .. py:property:: created_by :type: str .. py:property:: curve_table :type: CurveTable .. py:property:: layer_table :type: LayerTable .. py:property:: last_edited_by :type: str .. py:property:: point_table :type: PointTable .. py:property:: revision :type: int .. py:method:: new_revision() -> int Returns the updated revision count. .. rubric:: 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. .. py:method:: 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! :param path_to_file: Path to 3dm file, including file name and extension. :type path_to_file: str :returns: **success** -- ``True`` if the archive is read without error, ``False`` otherwise. :rtype: bool .. py:method:: reset() -> None Resets the current model. .. py:method:: write(path_to_file: str, version: int = 7) -> bool Writes the content of this model to an openNURBS archive. :param path_to_file: Path to 3dm file, including file name and extension. :type path_to_file: str :param version: Rhinoceros major varsion. :type version: ``int``, optional default to ``7`` :returns: **success** -- ``True`` if the archive is written without errors, ``False`` otherwise. :rtype: bool