In the console you write Python commands one by one, executing them by pressing Enter, while macros can contain more complex code made up of several lines, executed only when the macro is executed. In the Python console (select View → Panels → Python console from the menu) or in the Macro editor (select Macro → Macros. There are two ways to write Python code in FreeCAD. Redirect internal Python errors to report view.Redirect internal Python output to report view.If you are totally new to Python and want to understand how it works, we also have a basic introduction to Python.īefore proceeding with Python scripting, go to Edit → Preferences → General → Report view and check two boxes: In this tutorial, we'll work on a couple of basic examples to get you started, but there is much more documentation about Python scripting available on this wiki. From external scripts, which can used to create quite complex solutions, even entire Workbenches.From macros, which are a convenient way to quickly add a missing tool to the FreeCAD interface.From the FreeCAD Python interpreter, where you can issue commands in a "command line"-style interface.There are several ways to use Python in FreeCAD: Modify the 3D representation of those objects.From the Python console, or from custom scripts, you can control FreeCAD and make it perform very complex operations.įor example, from a Python script, you can: But its most widespread use is as a scripting language embedded in other applications. It is open-source and multi-platform, and can be used for many purposes: from simple shell scripts to very complex programs. Python is a programming language that it relatively easy to learn and understand.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |