+ fixes #0001537: python function to apply a placement to a shape
This commit is contained in:
parent
bddb6f9099
commit
27a2e52d66
|
@ -555,3 +555,21 @@ def removesubtree(objs):
|
|||
checkinlistcomplete = True
|
||||
for obj in toremove:
|
||||
obj.Document.removeObject(obj.Name)
|
||||
|
||||
def applyPlacement(shape):
|
||||
if shape.Placement.isNull():
|
||||
return shape
|
||||
else:
|
||||
import Part
|
||||
if shape.ShapeType == 'Solid':
|
||||
return Part.Solid(shape.childShapes()[0])
|
||||
elif shape.ShapeType == 'Face':
|
||||
return Part.Face(shape.childShapes())
|
||||
elif shape.ShapeType == 'Compound':
|
||||
return Part.Compound(shape.childShapes())
|
||||
elif shape.ShapeType == 'Wire':
|
||||
return Part.Wire(shape.childShapes())
|
||||
elif shape.ShapeType == 'Shell':
|
||||
return Part.Shell(shape.childShapes())
|
||||
else:
|
||||
raise ValueError('Unsupported shape type')
|
||||
|
|
Loading…
Reference in New Issue
Block a user