Sketcher: Intersection externals
This commit is contained in:
committed by
WandererFan
parent
c0f64a9850
commit
8c6b437314
@@ -557,19 +557,35 @@ PyObject* SketchObjectPy::addExternal(PyObject* args)
|
||||
{
|
||||
char* ObjectName;
|
||||
char* SubName;
|
||||
PyObject* defining; // this is an optional argument default false
|
||||
PyObject* defining; // this is an optional argument default false
|
||||
PyObject* intersection; // this is an optional argument default false
|
||||
bool isDefining;
|
||||
if (!PyArg_ParseTuple(args, "ssO!", &ObjectName, &SubName, &PyBool_Type, &defining)) {
|
||||
PyErr_Clear();
|
||||
if (!PyArg_ParseTuple(args, "ss", &ObjectName, &SubName)) {
|
||||
return nullptr;
|
||||
bool isIntersection;
|
||||
if (!PyArg_ParseTuple(args,
|
||||
"ssO!O!",
|
||||
&ObjectName,
|
||||
&SubName,
|
||||
&PyBool_Type,
|
||||
&defining,
|
||||
&PyBool_Type,
|
||||
&intersection)) {
|
||||
if (!PyArg_ParseTuple(args, "ssO!", &ObjectName, &SubName, &PyBool_Type, &defining)) {
|
||||
PyErr_Clear();
|
||||
if (!PyArg_ParseTuple(args, "ss", &ObjectName, &SubName)) {
|
||||
return nullptr;
|
||||
}
|
||||
else {
|
||||
isDefining = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
isDefining = false;
|
||||
isDefining = Base::asBoolean(defining);
|
||||
}
|
||||
isIntersection = false;
|
||||
}
|
||||
else {
|
||||
isDefining = Base::asBoolean(defining);
|
||||
isIntersection = Base::asBoolean(intersection);
|
||||
}
|
||||
|
||||
// get the target object for the external link
|
||||
@@ -590,7 +606,7 @@ PyObject* SketchObjectPy::addExternal(PyObject* args)
|
||||
}
|
||||
|
||||
// add the external
|
||||
if (skObj->addExternal(Obj, SubName, isDefining) < 0) {
|
||||
if (skObj->addExternal(Obj, SubName, isDefining, isIntersection) < 0) {
|
||||
std::stringstream str;
|
||||
str << "Not able to add external shape element " << SubName;
|
||||
PyErr_SetString(PyExc_ValueError, str.str().c_str());
|
||||
|
||||
Reference in New Issue
Block a user