Prevent linking non-existant or non-ifc file (#1604)

This commit is contained in:
Gorgious56
2021-07-29 09:03:53 +02:00
committed by GitHub
parent 110daf4ca7
commit e06591bbbd
+2 -1
View File
@@ -153,7 +153,8 @@ class SelectIfcFile(bpy.types.Operator):
filter_glob: bpy.props.StringProperty(default="*.ifc;*.ifczip;*.ifcxml", options={"HIDDEN"})
def execute(self, context):
bpy.context.scene.BIMProperties.ifc_file = self.filepath
if os.path.exists(self.filepath) and "ifc" in os.path.splitext(self.filepath)[1]:
bpy.context.scene.BIMProperties.ifc_file = self.filepath
return {"FINISHED"}
def invoke(self, context, event):