Sketcher: SketchGeometryExtensionPy getBlocked Python interface

This commit is contained in:
Abdullah Tahiri
2020-12-05 05:14:40 +01:00
committed by abdullahtahiriyo
parent d125007726
commit e2d55c3cea
2 changed files with 17 additions and 0 deletions

View File

@@ -31,5 +31,13 @@
</Documentation>
<Parameter Name="InternalType" Type="String"/>
</Attribute>
<Attribute Name="Blocked" ReadOnly="false">
<Documentation>
<UserDocu>
Sets/returns whether the geometry is blocked or not.
</UserDocu>
</Documentation>
<Parameter Name="Blocked" Type="Boolean"/>
</Attribute>
</PythonExport>
</GenerateModel>

View File

@@ -114,6 +114,15 @@ void SketchGeometryExtensionPy::setInternalType(Py::String arg)
throw Py::ValueError("Argument is not a valid internal geometry type.");
}
Py::Boolean SketchGeometryExtensionPy::getBlocked(void) const
{
return Py::Boolean(getSketchGeometryExtensionPtr()->testGeometryMode(GeometryMode::Blocked));
}
void SketchGeometryExtensionPy::setBlocked(Py::Boolean arg)
{
getSketchGeometryExtensionPtr()->setGeometryMode(GeometryMode::Blocked, arg);
}
PyObject *SketchGeometryExtensionPy::getCustomAttributes(const char* /*attr*/) const
{