- idsub1 = {}
- subList = []
- for s in sub1:
- idsub1[geompy.GetSubShapeID(obj, s)] = s
- for s in sub2:
- idsub = geompy.GetSubShapeID(obj, s)
- if idsub in list(idsub1.keys()):
- subList.append(s)
- logging.debug("subList=%s", subList)
- return subList
+
+ idsub1 = dict()
+ for subshape in sub1:
+ idsub1[geompy.GetSubShapeID(obj, subshape)] = subshape
+
+ l_subshapes = list()
+ for subshape in sub2:
+ idsub = geompy.GetSubShapeID(obj, subshape)
+ if idsub in idsub1:
+ l_subshapes.append(subshape)
+
+ logging.debug("l_subshapes=%s", l_subshapes)
+
+ return l_subshapes