Skip to content

Instantly share code, notes, and snippets.

@reox
Last active November 2, 2017 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save reox/62f6172ab1244e360a421bb55af5803f to your computer and use it in GitHub Desktop.
Save reox/62f6172ab1244e360a421bb55af5803f to your computer and use it in GitHub Desktop.
FreeCAD Macro to replace all placements with Nullplacements. This is important when using Assembly2 Workbench, to allow correct placement there.
print("Checking replacing all placements with default.")
print("===============================================")
for b in App.activeDocument().findObjects("PartDesign::Body"):
if not b.Placement.isNull():
print("!!! Body {} has a non null placement --> resetting!".format(b.Label))
b.Placement.Base = FreeCAD.Base.Vector()
b.Placement.Rotation = FreeCAD.Base.Rotation()
else:
print("Body {} looks fine...".format(b.Label))
print("done...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment