![]() ![]() The piston position is based on the top vertex (Vertex1 in my example, Vertexes, because the list is counted starting from 0): You should see the vertex name and position. Simple preselect a vertex and observe the status bar. ![]() Now you need to know sketch vertices names. Use to select the first object, in the script:Īpp.ActiveDocument.getObjectsByLabel("Conrod").Placement =Īpp.Placement(p2,App.Rotation(App.Vector(0, 0, 1),conrodangle)) 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. Next, copy last features from the piston and the conrod to the new file - features names are "Fusion" and "Pocket002" respectively. You need conrod and piston files (created during making of older tutorials): getObjectsByLabel("drivingskt").Ĭonrodangle = grees((App.Vector(0, 1, 0),(p1-p2)))Īpp.ActiveDocument.getObjectsByLabel("Piston").Placement = App.Placement(p1t,App.Rotation(App.Vector(0, 1, 0), 90))Īpp.ActiveDocument.getObjectsByLabel("Conrod").Placement = App.Placement(p2,App.Rotation(App.Vector(0, 0, 1),conrodangle)) Self.an = self.an + 0.01 if self.an < (2 * math.pi) else 0.0Īpp.ActiveDocument.getObjectsByLabel("drivingskt").setDatum(5,(str(angle)+' deg')) (self.timer, QtCore.SIGNAL("timeout()"), self.my_update) Import FreeCAD as App, FreeCADGui as Gui, Part, time, sys, math, Draft Open the following file: conrod-piston-anim.fcstd and paste in the FreeCAD Python console: Piston position and conrod position plus rotation are based on the sketch points positions. It does not use the assembly module at all. We are now finished with the basic workflow for the Drawing Workbench.This is simple sketch-driver piston + conrod animation. Specify the path and name of the exported file.Repeat for each group and set the values to the ones specified above.įreeCAD supports the export of SVG and PDF files based on your Drawings SVG Edit the X and Y coordinates to (140,100).Select the group or elements that you wish to project.With this procedure, it is possible to import Dimensions, Annotations, Shapestrings and any other element created whithin the Draft Workbench. The preferred way to add elements created in the Draft Workbench is with a tool contained in the Draft Workbench designed specifically for this. The same can be done for the Orthographic Projections. ![]() You can also alter the location, scale and rotation of the View from within the Data tab.
0 Comments
Leave a Reply. |