
#Freecad python scripting code
Now here comes the code for building a table using python script.ĭef make_box(name,length,width,height,base_vector,base_rotation): For this refer the earlier post Basic Example Using python script In the console you write python commands one by one, which are executed when you press return, while the macros can contain a more complex script made of several lines, which is executed only when the macro is executed.Īnother way in which you can embend python code in FreeCAD is by importing an external file in it. From the Macro editor (Tools -> Macros).From the python console (available from the View -> Views -> Python console menu).There are two easy ways to write python code in FreeCAD:


Python is a programming language, very simple to use and very fast to learn.
