Assembly: Fix : Reversing Distance Joint Moves Grounded Part #12457
This commit is contained in:
committed by
Yorik van Havre
parent
2d06d7d7d4
commit
bf0146ca86
@@ -73,6 +73,35 @@
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isJointConnectingPartToGround">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
Check if a joint is connecting a part to the ground.
|
||||
|
||||
isJointConnectingPartToGround(joint, propName) -> bool
|
||||
|
||||
Args:
|
||||
- joint: document object of the joint to check.
|
||||
- propName: string 'Part1' or 'Part2' of the joint.
|
||||
|
||||
Returns: True if part is connected to ground
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="isPartGrounded">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
Check if a part has a grounded joint.
|
||||
|
||||
isPartGrounded(obj) -> bool
|
||||
|
||||
Args:
|
||||
- obj: document object of the part to check.
|
||||
|
||||
Returns: True if part has grounded joint
|
||||
</UserDocu>
|
||||
</Documentation>
|
||||
</Methode>
|
||||
<Methode Name="exportAsASMT">
|
||||
<Documentation>
|
||||
<UserDocu>
|
||||
|
||||
@@ -97,6 +97,31 @@ PyObject* AssemblyObjectPy::isPartConnected(PyObject* args)
|
||||
return Py_BuildValue("O", (ok ? Py_True : Py_False));
|
||||
}
|
||||
|
||||
PyObject* AssemblyObjectPy::isPartGrounded(PyObject* args)
|
||||
{
|
||||
PyObject* pyobj;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O", &pyobj)) {
|
||||
return nullptr;
|
||||
}
|
||||
auto* obj = static_cast<App::DocumentObjectPy*>(pyobj)->getDocumentObjectPtr();
|
||||
bool ok = this->getAssemblyObjectPtr()->isPartGrounded(obj);
|
||||
return Py_BuildValue("O", (ok ? Py_True : Py_False));
|
||||
}
|
||||
|
||||
PyObject* AssemblyObjectPy::isJointConnectingPartToGround(PyObject* args)
|
||||
{
|
||||
PyObject* pyobj;
|
||||
char* pname;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "Os", &pyobj, &pname)) {
|
||||
return nullptr;
|
||||
}
|
||||
auto* obj = static_cast<App::DocumentObjectPy*>(pyobj)->getDocumentObjectPtr();
|
||||
bool ok = this->getAssemblyObjectPtr()->isJointConnectingPartToGround(obj, pname);
|
||||
return Py_BuildValue("O", (ok ? Py_True : Py_False));
|
||||
}
|
||||
|
||||
PyObject* AssemblyObjectPy::exportAsASMT(PyObject* args)
|
||||
{
|
||||
char* utf8Name;
|
||||
|
||||
Reference in New Issue
Block a user