bernd
Code: Select all
doc = App.ActiveDocument
# build a CompSolid out of two boxes
import Part
box_obj1 = doc.addObject('Part::Box', 'Box1')
box_obj2 = doc.addObject('Part::Box', 'Box2')
box_obj2.Placement.Base = (10, 0, 0)
import BOPTools.SplitFeatures
cs = BOPTools.SplitFeatures.makeBooleanFragments(name= 'CompSolid')
cs.Objects = [box_obj1, box_obj2]
cs.Mode = "CompSolid"
for obj in cs.ViewObject.Proxy.claimChildren():
obj.ViewObject.hide()
doc.recompute()
# test if we have solids
cs.Shape.Solids
# try to get the element 'Solid1'
solid_element = 'Solid1'
ele = cs.Shape.getElement(solid_element)
Code: Select all
>>> ele = cs.Shape.getElement(solid_element)
Traceback (most recent call last):
File "<input>", line 1, in <module>
SystemError: error return without exception set
OS: Debian GNU/Linux 8.6 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9166 (Git)
Build type: Unknown
Branch: master
Hash: 7a32aed27e5febf94611a3356d4f20b2bc6b6bf3
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.0.0