Material: better warning message if card name is not file name

This commit is contained in:
Bernd Hahnebach
2021-07-13 17:41:33 +02:00
parent df3ba55bf1
commit e9d1af3acc

View File

@@ -201,7 +201,10 @@ def write(filename, dictionary, write_group_section=True):
# first five lines are the same in any card file, see comment above read def
if header["CardName"] != card_name_file:
# CardName is the MatCard file name
FreeCAD.Console.PrintMessage("File CardName is used: {}\n".format(card_name_file))
FreeCAD.Console.PrintWarning(
"The file name {} is not equal to the card name {}. The file name is used."
.format(card_name_file, header["CardName"])
)
f.write("; " + card_name_file + "\n")
# f.write("; " + header["AuthorAndLicense"] + "\n")
f.write("; " + header.get("AuthorAndLicense", "no author") + "\n")