Skip to content

Instantly share code, notes, and snippets.

@yorikvanhavre
Created December 4, 2018 00:24
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 yorikvanhavre/f5412036e60c1ec0062e3e1d1fb9a7d6 to your computer and use it in GitHub Desktop.
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
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)
@yorikvanhavre
Copy link
Author

t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment