Macro ForceRecompute: Difference between revisions

From FreeCAD Documentation
No edit summary
m ('''Macro Force_Recompute.py''')
Line 4: Line 4:
{{Macro|Icon=Force_Recompute|Name=Macro Force Recompute|Description=Forces manual recompute of model|Author=shoogen|Version=1.0|Date=2014-09-01}}
{{Macro|Icon=Force_Recompute|Name=Macro Force Recompute|Description=Forces manual recompute of model|Author=shoogen|Version=1.0|Date=2014-09-01}}


===Description=== <!--T:2-->
==Description== <!--T:2-->
Sometimes the user applies changes to the model in FreeCAD.
Sometimes the user applies changes to the model in FreeCAD.
But FreeCAD does not seem to recognize them.
But FreeCAD does not seem to recognize them.
Line 13: Line 13:
Since FreeCAD v0.17, the effect of this macro can be achieved through GUI. Right-click project in model tree view, and pick "Mark to recompute" from context menu. After that, press [[Std_Refresh|Recompute]] button.
Since FreeCAD v0.17, the effect of this macro can be achieved through GUI. Right-click project in model tree view, and pick "Mark to recompute" from context menu. After that, press [[Std_Refresh|Recompute]] button.


===Use=== <!--T:3-->
==Use== <!--T:3-->
Just run the macro when needed.
Just run the macro when needed.


===Script=== <!--T:4-->
==Script== <!--T:4-->
'''Macro Force_Recompute.py'''
</translate>
</translate>

'''Macro Force_Recompute.py'''


{{Code|code=
{{Code|code=

Revision as of 15:35, 9 August 2018

Other languages:

File:Force Recompute Macro Force Recompute

Description
Forces manual recompute of model

Macro version: 1.0
Last modified: 2014-09-01
Author: shoogen
Author
shoogen
Download
None
Links
Macro Version
1.0
Date last modified
2014-09-01
FreeCAD Version(s)
None
Default shortcut
None
See also
None

Description

Sometimes the user applies changes to the model in FreeCAD. But FreeCAD does not seem to recognize them. So the blue "Recompute" icon stayes greyed out. This small macro forces a manual recompute of the model.

Since FreeCAD v0.17, the effect of this macro can be achieved through GUI. Right-click project in model tree view, and pick "Mark to recompute" from context menu. After that, press Recompute button.

Use

Just run the macro when needed.

Script

Macro Force_Recompute.py

# -*- coding: utf-8 -*-
# Force Recompute
# macro provided by shoogen

import FreeCAD
for obj in FreeCAD.ActiveDocument.Objects:
 obj.touch()
FreeCAD.ActiveDocument.recompute()