Translations:Scripted objects/37/en: Difference between revisions

From FreeCAD Documentation
(Importing a new version from external source)
 
(Importing a new version from external source)
Line 1: Line 1:
=== Things to note ===
=== Things to note ===
If your object relies on being recomputed as soon as it is created, you must do this manually in the {{include|__init__}} function as it is not called automatically. This example does not require it because the {{incode|onChanged}} method of the {{incode|Box}} class has the same effect as the {{include|execute}} function, but the examples below rely on being recomputed before anything is displayed in the 3D view. In the examples, this is done manually with {{incode|ActiveDocument.recompute()}} but in more complex scenarios you need to decide where to recompute either the whole document or the FeaturePython object.
If your object relies on being recomputed as soon as it is created, you must do this manually in the {{incode|__init__}} function as it is not called automatically. This example does not require it because the {{incode|onChanged}} method of the {{incode|Box}} class has the same effect as the {{incode|execute}} function, but the examples below rely on being recomputed before anything is displayed in the 3D view. In the examples, this is done manually with {{incode|ActiveDocument.recompute()}} but in more complex scenarios you need to decide where to recompute either the whole document or the FeaturePython object.

Revision as of 11:16, 24 May 2020

Information about message (contribute)
This message has no documentation. If you know where or how this message is used, you can help other translators by adding documentation to this message.
Message definition (Scripted objects)
If your object relies on being recomputed as soon as it is created, you must do this manually in the {{incode|__init__}} function as it is not called automatically.  This example does not require it because the {{incode|onChanged}} method of the {{incode|Box}} class has the same effect as the {{incode|execute}} function, but the examples below rely on being recomputed before anything is displayed in the 3D view.  In the examples, this is done manually with {{incode|ActiveDocument.recompute()}} but in more complex scenarios you need to decide where to recompute either the whole document or the FeaturePython object.

Things to note

If your object relies on being recomputed as soon as it is created, you must do this manually in the __init__ function as it is not called automatically. This example does not require it because the onChanged method of the Box class has the same effect as the execute function, but the examples below rely on being recomputed before anything is displayed in the 3D view. In the examples, this is done manually with ActiveDocument.recompute() but in more complex scenarios you need to decide where to recompute either the whole document or the FeaturePython object.