Created
December 4, 2018 00:24
-
-
Save yorikvanhavre/f5412036e60c1ec0062e3e1d1fb9a7d6 to your computer and use it in GitHub Desktop.
A FreeCAD macro that checks all visible objects for lines too tiny for Revit
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeCAD,FreeCADGui,Part | |
minl = 0.8 # 0.8 millimeters is the minimum line size that Revit is able to swallow. Pitiful, I know... | |
edges = [] | |
if FreeCAD.ActiveDocument: | |
for o in FreeCAD.ActiveDocument.Objects: | |
if o.ViewObject.Visibility == True: | |
if o.isDerivedFrom("Part::Feature"): | |
if o.Shape: | |
for e in o.Shape.Edges: | |
if e.Length <= minl: | |
edges.append(e) | |
if edges: | |
result = Part.makeCompound(edges) | |
Part.show(result) | |
FreeCADGui.Selection.clearSelection() | |
r = FreeCAD.ActiveDocument.Objects[-1] | |
r.ViewObject.LineWidth = 3 | |
FreeCADGui.Selection.addSelection(r) |
Author
yorikvanhavre
commented
Dec 4, 2018
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment