Macro Remove parametric history: Difference between revisions

From FreeCAD Documentation
(ajout de "|Icon=Text-x-python")
(<translate>)
Line 1: Line 1:
<translate>
{{Macro|Icon=Text-x-python|Name=Remove parametric history|Description=This will remove all parametric associativity from an object, leaving it as a "dumb" shape|Author=Yorik}}
{{Macro|Icon=Text-x-python|Name=Remove parametric history|Description=This will remove all parametric associativity from an object, leaving it as a "dumb" shape|Author=Yorik}}


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

</translate>

<syntaxhighlight>
newShape = originalObject.Shape.copy()
newShape = originalObject.Shape.copy()
newName = FreeCAD.ActiveDocument.ActiveObject.Name
newName = FreeCAD.ActiveDocument.ActiveObject.Name
Line 7: Line 13:
newObject.Shape = newShape
newObject.Shape = newShape


</syntaxhighlight>
{{languages | {{es|Macro_Remove_parametric_history/es}} {{fr|Macro_Remove_parametric_history/fr}} {{it|Macro_Remove_parametric_history/it}} }}
{{clear}}
<languages/>

Revision as of 18:14, 24 December 2013

File:Text-x-python Remove parametric history

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

Author: Yorik
Author
Yorik
Download
None
Links
Macro Version
1.0
Date last modified
None
FreeCAD Version(s)
None
Default shortcut
None
See also
None

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


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