Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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

This comment has been minimized.

Copy link
Owner Author

@yorikvanhavre yorikvanhavre commented Dec 4, 2018

t

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.