Skip to content
This repository was archived by the owner on May 19, 2025. It is now read-only.

Commit b6077fd

Browse files
committed
Fix issues after reorganization
1 parent 25a1689 commit b6077fd

File tree

12 files changed

+2161
-2395
lines changed

12 files changed

+2161
-2395
lines changed

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,6 @@ set( ACIS_SOURCES_Modeler
128128
src/acis_enums.h
129129
src/acis_operators.cpp
130130
src/acis_operators.h
131-
src/acis_spa.cpp
132-
src/acis_spa.h
133131
src/utilities.cpp
134132
src/utilities.h
135133
)

src/acis_api.cpp

Lines changed: 27 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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+
87110
PyObject *
88111
a3dp_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
}

src/acis_api.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "acis_operators.h"
2121
#include "acis_classes.h"
2222
#include "acis_enums.h"
23-
#include "acis_spa.h"
2423
#include "utilities.h"
2524

2625
#ifdef __cplusplus
@@ -30,6 +29,7 @@ extern "C" {
3029
PyObject *a3dp_api_start_modeller(PyObject *self, PyObject *args, PyObject *kwargs);
3130
PyObject *a3dp_api_stop_modeller(PyObject *self);
3231
PyObject *a3dp_is_modeler_started(PyObject *self);
32+
PyObject *a3dp_spa_unlock_products(PyObject *self, PyObject *arg);
3333
PyObject *a3dp_api_set_dbl_option(PyObject *self, PyObject *args, PyObject *kwargs);
3434
PyObject *a3dp_api_set_int_option(PyObject *self, PyObject *args, PyObject *kwargs);
3535
PyObject *a3dp_api_set_str_option(PyObject *self, PyObject *args, PyObject *kwargs);

0 commit comments

Comments
 (0)