However, when I open such file in FreeCAD the file name is changed to _1_something.FCstd, that is, the initial zero is replaced by an underscore.
This name is visible in the search view, and also in the Python console. Everything works as usual, the file works normally, when you save the file, the file is saved to the original name (with an initial zero); it just so happens that the string is shown as starting with an underscore inside FreeCAD.
For example, this is a file called 03_turbulent.FCstd. The operations recorded in the Python console give the impression that I'm using a file named _3_turbulent.FCstd. This is a very benign bug, but I find it strange. My initial thought was that FreeCAD changes a file name starting with zero (0) to avoid interpreting it for an octal number or something like that. I wonder what code handles processing of the file name.
As we know, every object inside FreeCAD is an object under the document's name. So maybe the code that initially creates the ActiveDocument object parses the name of the file, assigns the Name attribute, and then uses this attribute everywhere in the code. I think for the graphical user interface, the original string of the file name should be used.
I believe this happens with every version of FreeCAD that I've tried.
Code: Select all
print(App.ActiveDocument.Name) _3_turbulent App.ActiveDocument.object1 # _3_turbulent.object1 App.ActiveDocument.object2 # _3_turbulent.object2 App.ActiveDocument.OpenFOAM # _3_turbulent.OpenFOAM # etc.
Code: Select all
OS: Ubuntu 18.04.2 LTS Word size of OS: 64-bit Word size of FreeCAD: 64-bit Version: 0.18.1. Build type: Release Python version: 3.6.7 Qt version: 5.9.5 Coin version: 4.0.0a OCC version: 7.3.0 Locale: English/UnitedStates (en_US)