From 2d69c763c593f58d978e4600715815692fe4450e Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 16 Dec 2010 15:56:48 +0000 Subject: [PATCH] Add ExtractShape() function --- src/GEOM_SWIG/geompyDC.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/GEOM_SWIG/geompyDC.py b/src/GEOM_SWIG/geompyDC.py index 4f0bafa32..7fd33ba85 100644 --- a/src/GEOM_SWIG/geompyDC.py +++ b/src/GEOM_SWIG/geompyDC.py @@ -2237,6 +2237,21 @@ class geompyDC(GEOM._objref_GEOM_Gen): anObj = self.GetSubShape(aShape, ListOfIDs) return anObj + ## Extract shapes (main shape or sub-shape) of given type + # @param aShape shape + # @param aType shape type + def ExtractShapes(self, aShape, aType, sorted = False): + ret = [] + t = aShape.GetShapeType()._v + if hasattr(aType, "_v"): aType = aType._v + if t == aType: + ret.append(aShape ) + elif sorted: + ret = self.SubShapeAllSortedCentres(aShape, aType) + else: + ret = self.SubShapeAll(aShape, aType) + return ret + # end of l4_decompose_d ## @} -- 2.39.2