
(Right click to save as.)Your browser does not support the video tag.Example 2: an assembly created from the Part Design-created files.In this example we will create an assembly containing fully parametric, Part Design parts. jriegel/dev-assembly-old is the old data model with the working solver of ickby and the new PartDesign of jreinlaender.jriegel/dev-assembly2 is the new data model with the solvertemporarelly switched of.

While assembly tools are not available in the official packages, you can compile FreeCAD yourself with the assembly module enabled.Note: the module is unfinished, unstable and buggy.Instructions are similar to those Alternatively you can use theUpdate: This post is outdated now, the assembly module looks different, and there is no jriegel/dev-assembly branch anymore. GetObjectsByLabel('drivingskt')0.2 = App.ActiveDocument. Use 0 to select the first object, in the script:('drivingskt')0.setDatum(5,(str(angle)+' deg'))('Piston')0.Placement = App.Placement(p1t,App.Rotation(App.Vector(0, 1, 0), 90))('Conrod')0.Placement =App.Placement(p2,App.Rotation(App.Vector(0, 0, 1),conrodangle))Now you need to know sketch vertices names. We will use convenient method getObjectsByLabel Important: the method returns a list (one or several objects), you need only one object. Rename objects to Conrod, Piston and drivingskt respectively. Setting rotation axis to Y and rotating piston by 90 deg you should see something similar to:App.Placement( (App.Vector(0, 1, 0),App.Rotation(App.Vector(0, 1, 0), 90))First argument is the piston position (X, Y, Z), second describes rotation axis (0, 1, 0 means Y), third argument is angle in degrees. There are some small problems: you don't know conrod length, pin hole in piston position, finally the piston is rotated around Y axis by 90 degrees.Try change piston rotation, adjusting 'Placement' in the Data tab and observe Python console.



In the new file you should see both parts (as in the below image).
