diff --git a/src/Base/PlacementPyImp.cpp b/src/Base/PlacementPyImp.cpp index 76a19833a5..8607364822 100644 --- a/src/Base/PlacementPyImp.cpp +++ b/src/Base/PlacementPyImp.cpp @@ -247,8 +247,20 @@ void PlacementPy::setRotation(Py::Object arg) throw Py::TypeError("either Rotation or tuple of four floats expected"); } -PyObject *PlacementPy::getCustomAttributes(const char* /*attr*/) const +PyObject *PlacementPy::getCustomAttributes(const char* attr) const { + // for backward compatibility + if (strcmp(attr, "isNull") == 0) { + PyObject *w, *res; +#if PY_MAJOR_VERSION >= 3 + w = PyUnicode_InternFromString("isIdentity"); +#else + w = PyString_InternFromString("isIdentity"); +#endif + res = PyObject_GenericGetAttr(const_cast(this), w); + Py_XDECREF(w); + return res; + } return 0; } diff --git a/src/Mod/Arch/ArchComponent.py b/src/Mod/Arch/ArchComponent.py index 1a61bb7be2..aa6dc86a20 100644 --- a/src/Mod/Arch/ArchComponent.py +++ b/src/Mod/Arch/ArchComponent.py @@ -491,7 +491,7 @@ class Component: #print("Processing subshapes of ",obj.Label, " : ",obj.Additions) if placement: - if placement.isNull(): + if placement.isIdentity(): placement = None else: placement = FreeCAD.Placement(placement) @@ -625,19 +625,19 @@ class Component: else: shape = r obj.Shape = self.spread(obj,shape,placement) - if not placement.isNull(): + if not placement.isIdentity(): obj.Placement = placement else: if allownosolid: obj.Shape = self.spread(obj,shape,placement) - if not placement.isNull(): + if not placement.isIdentity(): obj.Placement = placement else: FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has no solid")+"\n") else: if allowinvalid: obj.Shape = self.spread(obj,shape,placement) - if not placement.isNull(): + if not placement.isIdentity(): obj.Placement = placement else: FreeCAD.Console.PrintWarning(obj.Label + " " + translate("Arch","has an invalid shape")+"\n") diff --git a/src/Mod/Arch/importIFClegacy.py b/src/Mod/Arch/importIFClegacy.py index c300a0bfb3..24f17d16b8 100644 --- a/src/Mod/Arch/importIFClegacy.py +++ b/src/Mod/Arch/importIFClegacy.py @@ -1212,7 +1212,7 @@ def getTuples(data,scale=1,placement=None,normal=None,close=True): for v in verts: pt = v.Point if placement: - if not placement.isNull(): + if not placement.isIdentity(): pt = placement.multVec(pt) if rnd: pt = DraftVecUtils.rounded(pt)