From 150e4c89cf6eb676c6469af7ad1b98a8a7876489 Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 19 Dec 2023 13:28:40 +0100 Subject: [PATCH] Use filename as project name if not defined - issue #57 --- ifc_tools.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ifc_tools.py b/ifc_tools.py index f905ab1..4662234 100644 --- a/ifc_tools.py +++ b/ifc_tools.py @@ -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: