getValue () # view direction vec = rotCamera. getValue ()) # this sets the lookat point to the center of circumsphere of the global bounding box view. Import math import time from FreeCAD import Base from pivy import coin size = ( 1000, 1000 ) dirname = "C:/Temp/animation/" steps = 36 angle = 2 * math. This macro displays in the report view the keys pressed and all events command Top Display keys pressed and Events command Rotation - a quaternion for the rotation, i.e.Button - The pressed button, could be BUTTON1.State - A string 'UP' if the button was up, 'DOWN' if it was down or 'UNKNOWN' for all other cases.AltDown - a boolean, true if Alt was pressed otherwise falseįor all button events, i.e.CtrlDown - a boolean, true if Ctrl was pressed otherwise false.ShiftDown - a boolean, true if Shift was pressed otherwise false.Position - a tuple of two integers, mouse position.Type - the name of the event type i.e.Depending on the watched event the dictionary can contain different keys. The Python function that can be registered with addEventCallback() expects a dictionary. SoSpaceballButtonEvent - spaceball button down and up events.SoMouseButtonEvent - mouse button down and up events.SoKeyboardEvent - key down and up events.SoMotion3Event - 3D movement events (normally spaceball).SoLocation2Event - 2D movement events (normally mouse movements).SoButtonEvent - all mouse button and key events.removeEventCallback ( "SoMouseButtonEvent", c ) addObject ( "Mesh::Feature", "Cube" ) me. scale ( 100.0 ) # add the mesh to the active document me = doc. Mesh () # build up box out of 12 facets m. activeDocument () # create a new empty mesh m = Mesh. Read and use it as a start for your own scripts.Įvery module must contain, besides your main module file, an InitGui.py file, responsible for inserting the module in the main Gui. This page contains examples, pieces, chunks of FreeCAD python code collected from users experiences and discussions on the forums. 2.46 How to create a face with holes using Python API.2.45 How to Simulate a Mouse Click at a given Coordinate.2.44 Create a Sketch on a Surface in PartDesign.2.42 Create one object to the position of the Camera.2.41 Get the normal vector of a surface from a STL file.2.40 Get the normal vector of the face and create a line at the point mouse clicked.2.39 Get the normal vector on the surface.2.38 Get the normal vector of an object selected and number of Face.2.37 Get the normal vector of a face of an object by Name object and number of Face.2.36 Get the normal vector of a face of an object by Name object and number Face (r.Q).2.35 Select a face of an object by Name object and Face number.2.34 Select all objects in the document.2.32 Manual search of an element with label.2.27 Find/select all elements below the cursor.2.26 Function resident with the mouse click action.2.25 List the dimensions of an object, given its name.2.23 Retrieve the coordinates of 3 selected points or objects.2.22 Get the HTML contents of an opened webpage.2.18 Add custom widgets to the interface.2.17 Save the sceneGraph in 3 series of 36 files. 2.16 Add and remove objects to/from the scenegraph.2.15 Manipulate the scenegraph in Python.2.14 Display keys pressed and Events command.2.13 Observe mouse events in the 3D viewer via Python.2.12 Observe camera change in the 3D viewer via Python.2.11 Replace the form of mouse with one image (cross) include.2.10 Replace the form of mouse with one image.2.9 Access and change the representation of an object.2.6 Add and remove an object to/from a group.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |