Macro PDWrapper

From FreeCAD Documentation
Revision as of 03:41, 15 October 2021 by TheMarkster (talk | contribs) (0.2021.10.14.rev7 -- add enable/disable to context menu)
Other languages:

Macro Pdwrapper

Description
Encapsulate non-Part Design solids to work in Part Design

Macro version: 0.2021.10.14.rev7
Last modified: 2021-10-14.rev7
FreeCAD version: python 3 versions
Download: ToolBar Icon
Author: TheMarkster
Author
TheMarkster
Download
ToolBar Icon
Links
Macro Version
0.2021.10.14.rev7
Date last modified
2021-10-14.rev7
FreeCAD Version(s)
python 3 versions
Default shortcut
None
See also

Description

PDWrapper encapsulates solids created in other workbenches inside a PartDesign::FeaturePython object so that they behave as if they were native Part Design features. In the screenshot below it shows a Part Workbench fillet of a Part Design Additive Box encapsulated inside a PDWrapper object of type Common Additive. But PDWrapper can do more than just encapsulate non-Part Design solids for use in a Part Design Body. It can also encapsulate Part Design features and change their nature. For example, you can encapsulate a Part Design 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‎

Legend

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://gist.githubusercontent.com/mwganson/4106e84eeaaf4d6e056cd286cbc39170/raw/db435cc0f4876a1a2d0da859f0c2e0a7b501a5fe/Pdwrapper.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://gist.githubusercontent.com/mwganson/4106e84eeaaf4d6e056cd286cbc39170/raw/db435cc0f4876a1a2d0da859f0c2e0a7b501a5fe/Pdwrapper.FCMacro")


ToolBar Icon

Script

Macro Pdwrapper.FCMacro