Macro PDWrapper

From FreeCAD Documentation
Other languages:

Macro Pdwrapper

Encapsulate non-PartDesign solids to work in PartDesign

Macro version: 0.2023.08.13
Last modified: 2023-08-13
FreeCAD version: python 3 versions
Download: ToolBar Icon
Author: TheMarkster
ToolBar Icon
Macro Version
Date last modified
FreeCAD Version(s)
python 3 versions
Default shortcut
See also


PDWrapper encapsulates solids created in other workbenches inside a PartDesign::FeaturePython object so that they behave as if they were native PartDesign features. In the screenshot below it shows a Part Workbench fillet of a PartDesign Additive Box encapsulated inside a PDWrapper object of type Common Additive. But PDWrapper can do more than just encapsulate non-PartDesign solids for use in a PartDesign Body. It can also encapsulate PartDesign features and change their nature. For example, you can encapsulate a PartDesign Hole inside a PDWrapper Additive type and turn the Hole into a threaded rod (presuming the Hole is threaded). With PDWrapper you can create types of Primitives that are not available, such as Common (Intersection) types and XOR types. It also allows to dynamically include/exclude some solid features from the Body's Tip shape.

Examples and full documentation can be found on github: PDWrapper.

Macro PDWrapper screenshot‎


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,
    "This macro must be downloaded from this link\n"
    "" + "\n"
    "Quit this window to access the download page")


import webbrowser"")

ToolBar Icon


Macro Pdwrapper.FCMacro