This article provides an explanation of FreeCAD scripting, specifically focusing on how to manipulate objects and create circles within specified bounds using Python. The article includes examples of defining dimensions and the number of circles needed, as well as calculating side lengths and margins to generate squares with given parameters.
import Part doc = FreeCAD.ActiveDocument # list all objects all_objects = doc.Objects # list all names all_object_names = [it.Name for it in all_objects] # get object by name obj = doc.getObject("myObjectName") # get vertex point vertex_point = obj.Shape.Vertexes[0].Point # create new line new_line = Part.makeLine((-200, -200, 0), (200, 200, 0)) # insert the line Part.show(new_line) # recompute the document doc.recompute()