Skip to content

Commit

Permalink
Use filename as project name if not defined - issue #57
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Dec 19, 2023
1 parent 41bd1ad commit 150e4c8
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ifc_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@ def add_properties(
ifcentity = get_ifc_element(obj)
if getattr(ifcentity, "Name", None):
obj.Label = ifcentity.Name
elif getattr(obj, "IfcFilePath", ""):
obj.Label = os.path.splitext(os.path.basename(obj.IfcFilePath))[0]
else:
obj.Label = "_" + ifcentity.is_a()
if isinstance(obj, FreeCAD.DocumentObject) and "Group" not in obj.PropertiesList:
Expand Down

0 comments on commit 150e4c8

Please sign in to comment.