OpenNURBSObject =============== .. py:class:: py3dm.OpenNURBSObject Python bindings for the openNURBS ``ON_Object`` class. ``ON_Object``: pure virtual base class for all classes that must provide runtime class id or support object level 3DM serialization. Returns .. py:method:: get_user_string(key: str) -> str Get the user string from the object. :param key: the key used to retrieve the user string. :type key: str :returns: **value** -- the ``str`` to be returned if the ``key`` has been found. Empty ``str`` is returned otherwise. :rtype: str .. py:method:: is_corrupt(repair: bool, silent_error: bool, text_log: TextLog) -> bool Check for corrupt data values that are likely to cause crashes. :param repair: If ``True``, ``const_cast<>`` will be used to change the corrupt data so that crashes are less likely. :type repair: bool :param silent_error: If ``True``, ON_ERROR will not be called when corruption is detected. :type silent_error: bool :param text_log: If text_log is not null, then a description of corruption is printed using text_log. :type text_log: TextLog .. rubric:: Notes Ideally, ``is_corrupt`` would be a virtual function on ``ON_Object``, but doing that at this point would break the public SDK. .. py:method:: is_valid(text_log: TextLog | None = None) -> bool Tests an object to see if its data members are correctly initialized. :param text_log: If the object is not valid and ``text_log`` is not ``None``, then a brief english description of the reason the object is not valid is appended to the log. The information appended to ``text_log`` is suitable for low-level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. :type text_log: `TextLog`, optional :returns: **success** -- ``True`` if the object is valid or ``False`` if the object is invalid, uninitialized, etc. :rtype: bool .. py:method:: remove_user_string(key: str) -> bool Remove a user string in the form of a ``key``-``value`` string pair from the object. :param key: key component of the string pair. :type key: str :returns: **success** -- ``True`` if successful. :rtype: bool .. py:method:: set_user_string(key: str, value: str) -> bool Attach a user string in the form of a ``key``-``value`` string pair to the object. This information will persist through copy construction, operator ``=``, and file IO. :param key: key component of the string pair. :type key: str :param value: value component of the string pair. :type value: str :returns: **success** -- ``True`` if successful. :rtype: bool .. py:method:: user_string_count() -> int Returns the number of user strings on the object.