@@ -84,6 +84,29 @@ a3dp_is_modeler_started(PyObject *self)
8484 Py_RETURN_FALSE;
8585}
8686
87+ PyObject *
88+ a3dp_spa_unlock_products (PyObject *self, PyObject *arg)
89+ {
90+ // Check if the input is a string
91+ if (!PyUnicode_Check (arg))
92+ {
93+ PyErr_SetString (PyExc_ValueError, " Expecting a string" );
94+ return NULL ;
95+ }
96+
97+ // Convert PyObject to C-style string
98+ const char *unlock_str = PyUnicode_AsUTF8 (arg);
99+
100+ // Call ACIS Licensing API
101+ spa_unlock_result out = spa_unlock_products (unlock_str);
102+
103+ // If license is good, then return True. Otherwise, return the licensing error message
104+ if (SPA_UNLOCK_PASS == out.get_state ())
105+ Py_RETURN_TRUE;
106+ else
107+ return PyUnicode_FromString (out.get_message_text ());
108+ }
109+
87110PyObject *
88111a3dp_api_set_dbl_option (PyObject *self, PyObject *args, PyObject *kwargs)
89112{
@@ -706,7 +729,7 @@ a3dp_api_unite(PyObject *self, PyObject *args, PyObject *kwargs)
706729 else
707730 {
708731 // Boolean operations automatically delete tool bodies, but for python, we need to set reference to NULL too
709- _a3dp_make_null (input_tool);
732+ __make_null (input_tool);
710733 // Returning none means that we have no errors
711734 Py_RETURN_NONE;
712735 }
@@ -762,7 +785,7 @@ a3dp_api_intersect(PyObject *self, PyObject *args, PyObject *kwargs)
762785 else
763786 {
764787 // Boolean operations automatically delete tool bodies, but for python, we need to set reference to NULL too
765- _a3dp_make_null (input_tool);
788+ __make_null (input_tool);
766789 // Returning none means that we have no errors
767790 Py_RETURN_NONE;
768791 }
@@ -818,7 +841,7 @@ a3dp_api_subtract(PyObject *self, PyObject *args, PyObject *kwargs)
818841 else
819842 {
820843 // Boolean operations automatically delete tool bodies, but for python, we need to set reference to NULL too
821- _a3dp_make_null (input_tool);
844+ __make_null (input_tool);
822845 // Returning none means that we have no errors
823846 Py_RETURN_NONE;
824847 }
@@ -874,7 +897,7 @@ a3dp_api_imprint(PyObject *self, PyObject *args, PyObject *kwargs)
874897 else
875898 {
876899 // Boolean operations automatically delete tool bodies, but for python, we need to set reference to NULL too
877- _a3dp_make_null (input_tool);
900+ __make_null (input_tool);
878901 // Returning none means that we have no errors
879902 Py_RETURN_NONE;
880903 }
0 commit comments