Macros recipes/it

Questa pagina contiene un elenco di macro con cui aggiungere delle funzionalità alla propria installazione di FreeCAD.

Object creation

 * [[Image:Macro_makeCube.png|16px]] : creates a rectangular cuboid from 4 points
 * : creates a solid by sweeping a 2D profile along a trajectory previously selected in the 3D view. The 2D elements can be created through the regular tools in FreeCAD's GUI.
 * : creates a parametric rectellipse
 * [[Image:Macro_Draft_Circle_3_Points.png|16px]] : creates a circle on 3 selected points, the points can be objects (this example brings together the two examples below, all parameters simply settle on a graphic window).
 * [[Image:Macro_Draft_Circle_3_Points.png|16px]] : creates a circle from 3 selected points 2D orthogonal
 * [[Image:Macro_Draft_Circle_3_Points.png|16px]] : creates a circle from 3 selected points in the space 3D
 * : This macro creates a screw with or without thread, according to ISO standards (screw_maker1_6.py.zip with Pyside support). (Screw Maker 2.0 - new version!)
 * : This macro creates a geodesic dome shell
 * [[Image:Macro_BOLTS.png|16px]] : The aim of BOLTS is to build a free and open-source standard parts library for CAD applications.
 * Makes an ellipse by selecting three points (in this order): centre, major radius and minor radius
 * : Imports and scales a .dat airfoil to desired chord length.
 * : Create a line giving coordinate XYZ length and angle to plane X Y
 * : Cut a line and create x points, giving the number of points, create line or not, create points or not, create bicolor or not on choice.
 * : Create a circle or arc giving radius, diameter, circumference, area, startangle, endangle, arc, anglecenter, cord, arrow, center (point) on choice.
 * : Cut a circle or arc and create x arcs, giving the number of cut.
 * [[Image:Macro_FCConvertLines.png|16px]] : this macro convert the object line, wire in line Dash, DashDot, DashDotDot,ZigZag and Hand with the dimensions given.
 * : This macro create one triangle creates a triangle by giving the head angle and the height of the triangle (the triangle of the head is positioned to the xyz coordinates 0.0)
 * [[Image:FCTexture.png|16px]] : Create a project from a bmp image to create a texture easily
 * [[Image:FCCreaLoft.png|16px]] : Create a loft with a list of wire (specially created for Macro FCTexture see above)
 * [[Image:FreeCAD Doc.png|16px]] : Starts the Parts library browser
 * [[Image:BoundBoxTracing.png|16px]] : This macro red trace (editable) around the BoundingBox with 6 rectangles
 * FCCircularTextButtom.png : This macro create a text around a cylinder
 * [[Image:GW_Dim.png|16px]] : Allows the user to create a Geneva wheel mechanism from scratch. Must edit values within the Macro to alter the size of the object.
 * [[Image:GW_Dim.png|16px]] : A GUI front end that allows the user to create a Geneva wheel mechanism from scratch.
 * : This macro creates a Wire with the coordinates extracted from a file. The coordinates X Y Z are separated by a space.
 * FCSpring_Helix_Variable.png : This macro create one spring truncate, the troncature is adjustable on the all coil to choice.
 * : This macro help you to create an Arch Axis System along a line with a set of parameters.
 * : creates side and top/bottom walls for a cabinet with drilled holes for connection parts of manufacturer Hettich.
 * Macro_Half_Hull_Model.png : This macro generates both three dimensional half-hull and full-hull models from a series of 2D line drawings.
 * : Create stair helix, create your stair nosing select and run the macro.
 * [[Image:Macro_ReproWire.png|16px]] : This macro reproduce all element selected subobject wire or face.
 * [[Image:Gearworkbech.png|16px]] : Additional Workbench to create different types of gears, involute gear, involute rack, cycloide gear, bevel gear.

Object transformation

 * : copies the selected object several times, on an array grid
 * : flattens draft wires that are not planar to their median Z coordinate
 * : flattens draft wires that are not planar to a plane defined by 3 points
 * : converts selected meshes to parts
 * [[Image:PartToVRML.png ‎|16px]] : Converts selected parts to VRML meshes for small size and faster loading (VRML models Kicad and Blender compatible)
 * : allows to find and joint all non connected edge to the closest non connected one using a line
 * : removes all parametric associativity from an object, leaving it as a "dumb" shape
 * : Forces the creation of a Wire from lines and arcs that don't necessarily touch each other. Use this if normal wire operation fails
 * : Sometimes arcs are transformed into BSplines, for example when scale operations have been applied to them. This macro recreates valid arcs from them. Useful before exporting to dxf
 * : Converts the selected Face to a single Sketch without constraints.
 * : Converts the selected Edges to a circular Arc if possible. Useful for restoring discretized arcs.
 * [[Image:Macro_CloneConvert.png ‎|16px]] : Creates a clone of the object and the converted in the chosen position and size (inch, mm, m, µm...). The base object is recognized in mm (FreeCAd base)
 * : This macro create face from a DXF file, the "Layer" are recognized separate and trained in groups.
 * : Macro for easy scaling drawings, graphics, diagram, blueprint and similar 2D images in Image workbench.
 * : apply linear space transformations to distort shapes. E.g., non-uniform scaling, shearing, mirroring, axes swapping.
 * [[Image:Macro_Connect_And_Sweep.png ‎|24px]] : This macro easily creates a connection between two objects, an object and a point or between two points (the center of the objects are the starting and ending points of the sweep) can be selected form a configurable ellipse polygon circle

3D View operations

 * This macro rotates the current view by 90° to the left. Only works if you are in Top view.
 * Provides a GUI to permit rotation of view by precise amounts in all three directions.
 * This macro allows you to temporarily put a texture image on the selected objects.
 * This small macro turns the arrow of the mouse in a precision cross.
 * This macro aligns the current view to a selected face.
 * This macro align the selected object to the current View and set the coordinates Placement of the camera.
 * This macro align the face of the selected object to the current View (in case face hole the hole is placed to the view).
 * This macro testing if one selection are duplicate, select the object IN THE 3D VIEW the "ForbiddenCursor" stay if the or one selection is duplicate, the macro stay resident.

Assistenti

 * Macro SheetMetalUnfolder: Crea una parte dispiegata da un parte in lamiera.
 * Macro UnrollRuledSurface: permette di srotolare le superfici rigate e di disegnare lo sviluppo in una pagina.
 * Macro UnfoldBox: permette di creare e disegnare lo sviluppo di un solido con facce piane.
 * Macro Geneva Wheel GUI: Una interfaccia grafica che permette all'utente di impostare i valori per creare un meccanismo Croce di Malta da zero.
 * [[Image:Part_Prism_Apothem.svg|16px]] Macro Apothem Based Prism GUI Una GUI che permette di creare un prisma basato sull'apotema del suo poligono base, (inraggio).

Utility

 * : shows how to give information to the user through the GUI.
 * [[Image:FCInfo.png|16px]] : Gives a series of information about the selected shape and can display a conversion of length, inclination (degrees, radian, grade) shape, surface, volume and the weight of the form in the density selected in various international and Anglo-Saxon  units
 * [[Image:FCInfo.png|16px]] : same as above, but for Linux
 * [[Image:Macro_FCInfoGlass.png|16px]] : Gives a series of information about the selected shape and displayed in screen 3D
 * [[Image:FCInfoToMouse.png|16px]] : Provide informations coordinates, length and angles in real time on the mouse in a bubble annotation displayed in the 3D screen
 * : Exports current design to slicer software or CAM software.
 * : Gives the Delta values and the distance between 2 points
 * CenterFace.png : This macro red trace (editable) the center face (mass) with 1 point and print the coordinates
 * : User-friendly "Info" module created by a FreeCAD user
 * : Add the macros found in the macros folder to the Macros menu of FreeCAD
 * [[Image:Force_Recompute.png|16px]] : Forces manual recompute of model
 * : Shake a sketch in order to discover its unconstrained parts.
 * [[Image:Replace_Part.png|16px]] : Replaces a part (simple copy) in an "Assembly" with another Part (simple copy).
 * WF_wf.png : Tool utility to create plans of the axes, planes from 3 points, axes on a form, information on the coordinates of the shape and many other useful features to facilitate the creation of your project. This utility is up next in the combo view.
 * Macro_Dump_Objects.png : This macro generates a listing of all objects in the current document - the list can be in a window or on the Report view.
 * : This pair of macros allow you to alter the Navigation Style while in the Sketcher.
 * Macro_Toggle_Drawstyle.png : This macro toggles the Drawstyle of the selected object
 * Macro_Toggle_Views_Visibility.png : This macro toggles the visibility of various supporting views in FreeCAD, allowing the main window to be viewed with all available screen space.
 * Macro_Python_Assistant_Window.png : This macro provides a cut/copy/paste workspace for Python code, it is segmented so different sections can be selected and it is persistent between FreeCAD sessions.
 * Macro_Build_Utility.png : This macro provides a utility to assemble a project from sub-project files using the Merge Project facility.
 * FCCamera_00.png : This macro can rotate the screen in a defined angle and the defined axis and creates a plan to face the screen to create a form in the specified plan positions the selected face facing the screen, to detect the position of the camera ...
 * Macro_Global_Variable_Watcher.png : This macro facilitates the user selecting global variables and monitoring their values.
 * : Highlight common parts.
 * [[Image:HighlightDifference.png|16px]] : Compute the difference between two shapes.
 * [[Image:PropertyMemo.png|16px]] : This little macro create one Property additional (memo or other text) for you object (only Draft)
 * [[Image:Macro SelectVisible.png|16px]] : Set of three macro, macro 1: hidden the objects not selected, macro 2: displayed alls objects, macro 3: hidden alls objects.
 * [[Image: SelectVisible.png|16px]] : All visible objects in the tree will be selected.
 * : displays an interactively slidable cross-section.
 * [[Image: MeasureCircle.png|16px]] : Compute the radius of a circle by 3 points or a circular edge.

Mathematical functions

 * : Draw a function described by parametric equations x(t), y(t) and z(t).
 * : draws a function described by an equation z=F(x)
 * : Based on the above macro, but for parametric and optionally polar equations.

Animation

 * : Rotation rod and piston
 * : Simulation of one spring
 * : Open and close hinge
 * : Assembly animate
 * : Animate angle constrain in sketcher
 * : Simulation of movements of a 3D printer

Raytracing

 * : Exporta da FreeCAD a Kerkythea

FEM

 * : Create FEM Meshes by GMSH Mesh Generator

Drawing Workbench

 * : allows the user to get the view of his object in a drawing with 4 different position(front,top,iso,right). Needs some modification to be perfectly effective
 * : pops up a dialog asking for the dimensions of your corner piece, then creates the object in the document and creates a page view with top, front and lateral views of the piece
 * : This GUI macro to fill simply all fields of the cartridge of the plan implementation worksheet FreeCAD, the format of the date and the symbol of the projection mode adapt to the EU region or US selected.
 * ) This GUI macro to fill simply all fields of the cartridge model 1 of the plan implementation worksheet FreeCAD, the format of the date and the symbol of the projection mode adapt to the EU region or US selected.
 * ) This GUI macro to fill simply all fields of the cartridge model 2 of the plan implementation worksheet FreeCAD.
 * : Get the normal vector of a preselected face for creating a drawing view normal to that face

Come utilizzare le macro
Le macro di cui sopra possono essere facilmente inserite in qualsiasi installazione di FreeCAD:
 * Copiare il codice python della macro dalla pagina della macro corrispondente
 * In FreeCAD selezionare Macro-> Macro-> Crea nuova e assegnare un nome
 * Incollare il codice python copiato
 * Premere il pulsante Salva e riavviare FreeCAD
 * Aprire il gestore delle Macro, selezionare la nuova macro e fare clic su "Esegui"
 * Tutorial Come installare le Macro

Inoltre, è anche possibile aggiungere la nuova macro a una barra degli strumenti personalizzata
 * In FreeCAD, andare in Strumenti -> Personalizza
 * Nella scheda Macro, aggiungere una nuova macro, e, volendo, definire un'icona e una scorciatoia da tastiera
 * Nella scheda Barre degli strumenti, creare una nuova barra degli strumenti, e aggiungere le macro selezionandole nella categoria "Macro".
 * Tutorial Personalizzare la barra degli strumenti

Aggiungere nuove macro a questo repository
"Macro My Excellent Macro: My excellent macro". L'operazione crea una nuova pagina (link rosso).
 * Creare una nuova pagina il cui nome inizi con "Macro", per esempio "Macro_My_Excellent_Macro". Questo si può fare modificando semplicemente la presente pagina, e aggiungendo un nuovo collegamento alla macro, ad esempio:
 * Nella pagina appena creata, incollare il seguente testo:

Esempio con icona di default: Esempio con icona personalizzata: In altra lingua, con icona di default, ad esempio "/fr" "/de" "/it": In altra lingua, con icona personalizzata, ad esempio "/fr" "/de" "/it": Ricordare che l'icona deve avere lo stesso nome della macro.
 * Si può anche caricare una icona personalizzata in formato .png
 * esempio : " Macro_My_Excellent_Macro " senza estensione (l'estensione viene fornita dal sistema), e, sostituire " Icon=Text-x-python " con " Icon=Macro_My_Excellent_Macro "
 * Text-x-python [[Image:Text-x-python.png|32px]] è l'icona di default della pagina dedicata alle Macro.


 * Incollare la macro, e utilizzare Code template per evitare di aggiungere spazi nello script. La macro viene visualizzata in un font a spaziatura fissa all'interno di un riquadro di colore grigio chiaro come nell'esempio precedente.
 * Si può caricare un'icona .png con lo stesso nome della macro, per esempio Macro_My_Excellent_Macro.png
 * Aggiungere un'immagine: l'immagine è utile per mostrare cosa fa la macro. Opzionalmente è possibile creare una gif animata che rappresenta l'oggetto nel contesto. Creare le Gif Animate con dimensione massima di 500x500px, il sito non accetta il loro ridimensionamento. Le gif animate ridimensionate sono visualizzate come immagini fisse.
 * Opzionalmente è possibile aggiungere ancora delle informazioni su come utilizzare la macro, consigli, limitazioni e trucchi.
 * Aggiungerla a una delle categorie di cui sopra, oppure creare una nuova categoria, se è necessario.
 * È anche interessante includere nella macro le informazioni sulla versione di FreeCAD utilizzata per costruirla. La macro può così essere confrontata con l'evoluzione di FreeCAD. Fare "Menu → Aiuto → About FreeCAD" e poi cliccare su "Copia negli appunti" e incollare le informazioni nella macro

Es:

Si consiglia inoltre di creare una intestazione nella macro, questa intestazione può essere utilizzata dal programma Plugin Loader per installare le macro e controllare le versioni. È anche disponibile la addons_installer.FCMacro

Es:

Aggiungerla alle categorie di cui sopra, o creare una nuova categoria, se è necessario.