Macro Remove parametric history: Difference between revisions

From FreeCAD Documentation
m (space)
m (Script)
Line 6: Line 6:
==Description== <!--T:2-->
==Description== <!--T:2-->
This will remove all parametric associativity from an object, leaving it as a "dumb" shape
This will remove all parametric associativity from an object, leaving it as a "dumb" shape



<!--T:3-->
<!--T:3-->
Before and after:
Before and after:



<!--T:4-->
<!--T:4-->
[[File:RPH_before.png|left]] [[File:RPH_after.png]]
[[File:RPH_before.png|left]] [[File:RPH_after.png]]
{{clear}}
{{clear}}

==Script==
</translate>
</translate>
==Script==


'''Remove parametric history.FCMacro'''
'''Remove parametric history.FCMacro'''

Revision as of 14:21, 9 August 2018

File:Text-x-python Remove parametric history

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

Macro version: 1.0
Last modified: 2011-08-01
Author: Yorik
Author
Yorik
Download
None
Links
Macro Version
1.0
Date last modified
2011-08-01
FreeCAD Version(s)
None
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:

Script

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