From 893328f1daad41e66e317a6a7d16cf7c44e2b943 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Sat, 31 Oct 2015 20:14:10 +0300 Subject: [PATCH] Fix subcompounding of lattice objects After implementing an info tool, I noticed lattices are not structured the way I wanted. Seems like either importing or exporting a brep makes the shape wrapped into a compound. Unwrapping manually... --- latticeMarkers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/latticeMarkers.py b/latticeMarkers.py index 7f2dc4a..d01f4ea 100644 --- a/latticeMarkers.py +++ b/latticeMarkers.py @@ -66,6 +66,8 @@ def loadShape(shapeID): sh = Part.Shape() f = open(getShapePath(shapeID + '.brep')) sh.importBrep(f) + if sh.ShapeType == "Compound": + sh = sh.childShapes()[0] f.close() except Exception as err: FreeCAD.Console.PrintError('Failed to load standard shape "'+shapeID+'". \n' + err.message + '\n')