Macro ForceRecompute: Difference between revisions

From FreeCAD Documentation
m (Description +)
(Marked this version for translation)
 
(8 intermediate revisions by 5 users not shown)
Line 1: Line 1:
<languages/>
<languages/>
<translate>
<translate>

<!--T:1-->
<!--T:1-->
{{Macro
{{Macro
|Name=Macro Force Recompute
|Name=Macro Force Recompute
|Icon=Force_Recompute.png
|Icon=Force_Recompute.png
|Description=This small macro forces a manual recompute of the model.<br>Sometimes the user applies changes to the model in FreeCAD.<br>But FreeCAD does not seem to recognize them.<br>(As of {{Version|0.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.)
|Description=This small macro forces a manual recompute of the model.
|Author=shoogen
|Author=shoogen
|Version=1.0
|Version=1.0
|Date=2014-09-01
|Date=2014-09-01
|FCVersion=All
|Download=[https://www.freecadweb.org/wiki/images/8/88/Force_Recompute.png ToolBar Icon]
}}
}}


==Description== <!--T:2-->
==Description== <!--T:2-->

Sometimes the user applies changes to the model in FreeCAD.
<!--T:6-->
But FreeCAD does not seem to recognize them.
Sometimes when a user applies changes to the model, FreeCAD does not seem to recognize/integrate them. In addition to that, the blue {{Button|[[Image:Std_Refresh.svg|24px]] [[Std_Refresh|Refresh/Recompute]]}} button remains greyed out. Hence this small macro was designed to force a manual recompute of the model.
So the blue "Recompute" icon [[File:View-refresh.svg|16px]] stayes greyed out.
This small macro forces a manual recompute of the model.


<!--T:5-->
<!--T:5-->
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.
'''Note:''' As of {{VersionPlus|0.17}} the effect of this macro can be achieved through the GUI. Right-click project in [[Tree_view|model tree view]], and pick {{KEY|Mark to recompute}} from the context menu. What this does is make the Refresh/Recompute icon active again. Now press on the [[Image:Std_Refresh.svg|24px]] [[Std_Refresh|Refresh/Recompute]] button to trigger a recompute.


==Use== <!--T:3-->
==Usage== <!--T:3-->

Just run the macro when needed.
<!--T:7-->
Run the macro when necessary.


==Script== <!--T:4-->
==Script== <!--T:4-->

<!--T:8-->
ToolBar Icon
</translate>
</translate>
[[Image:Force_Recompute.png|24px]]


'''Macro Force_Recompute.py'''
'''Macro Force_Recompute.py'''


{{Code|code=
{{MacroCode|code=
# -*- coding: utf-8 -*-
# -*- coding: utf-8 -*-
# Force Recompute
# Force Recompute

Latest revision as of 19:42, 28 March 2022

Other languages:

Macro Force Recompute

Description
This small macro forces a manual recompute of the model.
Sometimes the user applies changes to the model in FreeCAD.
But FreeCAD does not seem to recognize them.
(As of introduced in version 0.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.)

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

Description

Sometimes when a user applies changes to the model, FreeCAD does not seem to recognize/integrate them. In addition to that, the blue Refresh/Recompute button remains greyed out. Hence this small macro was designed to force a manual recompute of the model.

Note: As of version 0.17 and above the effect of this macro can be achieved through the GUI. Right-click project in model tree view, and pick Mark to recompute from the context menu. What this does is make the Refresh/Recompute icon active again. Now press on the Refresh/Recompute button to trigger a recompute.

Usage

Run the macro when necessary.

Script

ToolBar Icon

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()