FreeCAD Logo FreeCAD 1.0
  • English Afrikaans Arabic Belarusian Catalan Czech German Greek Spanish Spanish Basque Finnish Filipino French Galician Croatian Hungarian Indonesian Italian Japanese Kabyle Korean Lithuanian Dutch Norwegian Bokmal Polish Portuguese Portuguese Romanian Russian Slovak Slovenian Serbian Swedish Turkish Ukrainian Valencian Vietnamese Chinese Chinese
  • Features
  • Download
  • Blog
  • Documentation
    Documentation index Getting started Users documentation The FreeCAD manual Workbenches documentation Python coding documentation C++ coding documentation Tutorials Frequently asked questions Privacy policy About FreeCAD
  • Contribute
    How to help Sponsor Report a bug Make a pull request Jobs and funding Contribution guidelines Developers handbook Translations
  • Community
    Code of conduct Forum The FPA GitHub GitLab Codeberg Mastodon Matrix IRC IRC via Webchat Gitter Discord Reddit Twitter Facebook LinkedIn Calendar
  • ♥ Donate

Donate

$
SEPA Information
Please set up your SEPA bank transfer to:
Beneficiary: The FreeCAD project association
IBAN: BE04 0019 2896 4531
BIC/SWIFT: GEBABEBBXXX
Bank agency: BNP Paribas Fortis
Address: Rue de la Station 64, 1360 Perwez, Belgium

While Stripe doesn't support monthly donations, you can still become a sponsor! Simply make a one-time donation equivalent to 12 months of support, and you'll gain access to the corresponding sponsoring tier. It's an easy and flexible way to contribute.

If you are not sure or not able to commit to a regular donation, but still want to help the project, you can do a one-time donation, of any amount.

Choose freely the amount you wish to donate one time only.

You can support FreeCAD by sponsoring it as an individual or organization through various platforms. Sponsorship provides a steady income for developers, allowing the FPA to plan ahead and enabling greater investment in FreeCAD. To encourage sponsorship, we offer different tiers, and unless you choose to remain anonymous, your name or company logo will be featured on our website accordingly.

from 1 USD / 1 EUR per month. You will not have your name displayed here, but you will have helped the project a lot anyway. Together, normal sponsors maintain the project on its feet as much as the bigger sponsors.

from 25 USD / 25 EUR per month. Your name or company name is displayed on this page.

from 100 USD / 100 EUR per month. Your name or company name is displayed on this page, with a link to your website, and a one-line description text.

from 200 USD / 200 EUR per month. Your name or company name and logo displayed on this page, with a link to your website and a custom description text. Companies that have helped FreeCAD early on also appear under Gold sponsors.

Instead of donating each month, you might find it more comfortable to make a one-time donation that, when divided by twelve, would give you right to enter a sponsoring tier. Don't hesitate to do so!

Choose freely the amount you wish to donate each month.

Please inform your forum name or twitter handle as a notein your transfer, or reach to us, so we can give you proper credits!

Macro_3D_Printer_3mf_Workflow

Description
FreeCAD macro exporting smooth 3MF files and preserving all slicer print settings, with automatic workflow to your preferred slicer.

Macro version: 00.02
Last modified: 2026-02-14
FreeCAD version: All
Download: Toolbar icon

Macro 3D_Printer_3mf_Workflow 3D_Printer_3mf_Workflow_ConfigIni.FCMacro
Author: 2cv001

Author
2cv001
Download
Toolbar icon

Macro 3D_Printer_3mf_Workflow 3D_Printer_3mf_Workflow_ConfigIni.FCMacro

Links
Macros recipes
How to install macros
How to customize toolbars
Macro Version
00.02
Date last modified
2026-02-14
FreeCAD Version(s)
All
Default shortcut
None
See also
None

Description

FreeCAD macro exporting smooth 3MF files and preserving all slicer print settings, with automatic workflow to your preferred slicer.

Temporary code for external macro link. Do not use this code. This code is used exclusively by Addon Manager. Link for optional manual installation: Macro


# This code is copied instead of the original macro code
# to guide the user to the online download page.
# Use it if the code of the macro is larger than 64 KB and cannot be included in the wiki
# or if the RAW code URL is somewhere else in the wiki.

from PySide import QtGui, QtCore

diag = QtGui.QMessageBox(QtGui.QMessageBox.Information,
    "Information",
    "This macro must be downloaded from this link\n"
    "\n"
    "https://raw.githubusercontent.com/2cv001/3D_printer_3mf_workflow/main/3D_Printer_3mf_Workflow.FCMacro" + "\n"
    "\n"
    "Quit this window to access the download page")

diag.setWindowFlags(QtCore.Qt.WindowStaysOnTopHint)
diag.setWindowModality(QtCore.Qt.ApplicationModal)
diag.exec_()

import webbrowser 
webbrowser.open("https://raw.githubusercontent.com/2cv001/3D_printer_3mf_workflow/main/3D_Printer_3mf_Workflow.FCMacro")
<class="rawcodeurl"><a href="https://raw.githubusercontent.com/2cv001/3D_printer_3mf_workflow/main/3D_Printer_3mf_Workflow.FCMacro">raw code</a>


More detailed description:

https://github.com/2cv001/3D_printer_3mf_workflow/blob/main/README.md

Purpose

This macro automates and enhances the 3D printing workflow from FreeCAD to your slicer by:

  • Generating smooth 3D prints without visible facets.
  • Preserving print settings (temperature, supports, speed…) in a way that keeps them linked to the FreeCAD project.
  • Launching external programs to streamline the full pipeline: FreeCAD → Slicer → Print.

This macro is the successor to macro 3d_printer_workflow.

The 3D_Printer_Workflow macro was already capable of producing smooth, facet‑free exports. Its main limitation was that it relied on STL files, which cannot store slicer or printing parameters.

This macro uses .3mf files, allowing all print settings to be saved and reused.

To retain the core functionality of the previous macro, this version also provides an STL export option with adjustable tessellation parameters, allowing smooth mesh generation just like before.

Limitation

The current version can export only a single object, but you can work around this by using links — for example, a Simple Group — to combine multiple objects into one.

Principle of smoothing

With visible facets

Without visible facets

The macro exports the selected objects to a 3MF file using the specified tessellation parameters (LinearDeflection and AngularDeflection). It generates temporary mesh objects for the export process and automatically removes them afterward.

Launching other programs or commands

The macro allows you to define custom commands that will be executed automatically after the 3MF file is generated. This feature is optional and can be used to automate additional steps in your workflow, such as:

  • copying the generated 3MF file to another location
  • turning on your 3D printer through a smart plug
  • turn a light on
  • pre‑heating the build plate
  • sending an HTTP request to your home automation system
  • launching a script or external tool

Principle diagram

Setup

A dedicated helper macro is provided to make configuration easy. Your commands are stored in an .ini file used by the workflow.

The ⚙️ button in the options window allows you to both install and open the configuration macro (3D_Printer_3mf_Workflow_ConfigIni.FCMacro).

  • Fill in the fields in the configuration window
  • Hover your mouse over a column title to display help tooltips
  • Each command you define will be executed in order after the 3MF file is produced.

Macro_3D_Printer_3mf_workflow capture écrant

Using %PROJECT%, %PROJECTDIR%, and %PROJECTNAME% in user commands

When you define custom post‑processing commands in the workflow, you can use three special placeholders. These placeholders are automatically replaced by values derived from your FreeCAD project file.

Available placeholders

Placeholders and their meaning:

  • %PROJECT%: Full path of the FreeCAD project without extension
  • %PROJECTDIR%: Folder containing the FreeCAD project
  • %PROJECTNAME%: Project file name without extension

Examples

Copy the generated 3MF file next to the project :

copy "%PROJECT%.3mf" "%PROJECTDIR%/backup/%PROJECTNAME%.3mf"

Run a script stored in the project folder :

python "%PROJECTDIR%/scripts/postprocess.py" "%PROJECT%.3mf"

Send an HTTP request using the project name :

curl "http://myserver/api/start?job=%PROJECTNAME%"

Turn on a Shelly smart plug Gen 1

curl "http://192.168.xxx.xxx/relay/0?turn=on"

Gen2

http://192.168.xxx.xxx/rpc/Switch.Set?id=0&on=true

Or if your device have a password :

curl -u admin:yourpassword "http://192.168.xxx.xx/rpc/Switch.Set?id=0&on=true"

Usage

More details at https://github.com/2cv001/3D_printer_3mf_workflow

Discussion

English : https://forum.freecad.org/viewtopic.php?t=102503

French : https://forum.freecad.org/viewtopic.php?t=103419

Script

ToolBar Icon

Code

ver 00.02 2026/02/14 by 2cv001 3D_Printer_3mf_Workflow.FCMacro

Download

Download latest version of the macro

This page is retrieved from https://wiki.freecad.org/Macro_3D_Printer_3mf_Workflow

Get in touch!
Forum GitHub Mastodon Matrix IRC Gitter.im Discord Reddit Twitter Facebook LinkedIn

© The FreeCAD Team. Homepage image credits (top to bottom): ppemawm, r-frank, epileftric, regis, rider_mortagnais, bejant.

This project is supported by: , KiCad Services Corp. and other sponsors

GitHubImprove this page on GitHub