Macro Remove parametric history

From FreeCAD Documentation
Jump to: navigation, search
Other languages:
čeština • ‎Deutsch • ‎English • ‎español • ‎français • ‎italiano

Macro Remove parametric history.png Remove parametric history

Description
This will remove all parametric associativity from an object, leaving it as a "dumb" shape

Macro version : 1.0
Date last modification : 2011-08-01
FreeCAD version : All
Download : ToolBar Icon
Author
Yorik
Download
ToolBar Icon
Links
Macro Version
1.0
Date last modification
2011-08-01
FreeCAD Version(s)
All
Default shortcut
None
See also
None


Description

This will remove all parametric associativity from an object, leaving it as a "dumb" shape

Before and after:

RPH before.png

RPH after.png

Script

ToolBar Icon Macro Remove parametric history.png

Remove parametric history.FCMacro

originalObject = FreeCAD.ActiveDocument.ActiveObject
newShape = originalObject.Shape.copy()
newName = FreeCAD.ActiveDocument.ActiveObject.Name
FreeCAD.ActiveDocument.removeObject(newName)
newObject = FreeCAD.ActiveDocument.addObject("Part::Feature",newName)
newObject.Shape = newShape