From abb2e516b1936da9bd0de0d14f405a00a32877b9 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Wed, 19 Dec 2018 02:37:56 +0300 Subject: [PATCH] BaseFeature: recognize App::Placement and PartDesign::CoordinateSystem as a Lattice Placement --- lattice2BaseFeature.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lattice2BaseFeature.py b/lattice2BaseFeature.py index 0176c36..15fc280 100644 --- a/lattice2BaseFeature.py +++ b/lattice2BaseFeature.py @@ -77,6 +77,8 @@ def isObjectLattice(documentObject): if hasattr(documentObject,"isLattice"): if 'On' in documentObject.isLattice: ret = True + if documentObject.isDerivedFrom('App::Placement') or documentObject.isDerivedFrom('PartDesign::CoordinateSystem'): + ret = True if documentObject.isDerivedFrom('PartDesign::ShapeBinder'): if len(documentObject.Support) == 1 and documentObject.Support[0][1] == ('',): ret = isObjectLattice(documentObject.Support[0][0]) @@ -355,6 +357,8 @@ def getPlacementsList(documentObject, context = None, suppressWarning = False): if not isObjectLattice(documentObject): if not suppressWarning: lattice2Executer.warning(context, documentObject.Name + " is not a placement or an array of placements. Results may be unexpected.") + if documentObject.isDerivedFrom('App::Placement') or documentObject.isDerivedFrom('PartDesign::CoordinateSystem'): + return [documentObject.Placement] leaves = LCE.AllLeaves(documentObject.Shape) return [leaf.Placement for leaf in leaves]