Skip to content

Commit

Permalink
Filter out 2D objects when locking (provisory)
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 26, 2024
1 parent 617f08b commit 1024d18
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion ifc_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def unlock_document():
if "IfcFilePath" in doc.PropertiesList:
# this is a locked document
doc.openTransaction("Unlock document")
children = [ifc_tools.get_object(o) for o in ifc_tools.get_children(doc)]
children = [o for o in doc.Objects if not o.InList]
if children:
project = ifc_tools.create_document_object(doc, filename = doc.IfcFilePath, silent = True)
project.Group = children
Expand Down Expand Up @@ -195,4 +195,15 @@ def find_toplevel(objs):
break
else:
nobjs.append(obj)
# filter out 2D objects
objs = nobjs
nobjs = []
for obj in objs:
if obj.isDerivedFrom("Part::Feature"):
if obj.Shape.Edges and not obj.Shape.Solids:
print("Excluding",obj.Label,"- 2D objects not supported yet")
else:
nobjs.append(obj)
else:
nobjs.append(obj)
return nobjs

0 comments on commit 1024d18

Please sign in to comment.