I created a macro that does some cool stuff, but unfortunately it kills FreeCAD without any helpful output or logs to work with.
So I went and looked manually for the critical operation. The following is an abstract process of what my script does, just to reproduce the issue. Basically what I want to do is to have a TechDraw-Drawing showing some geometry. But additionally to normal dimensions I want to use the "expertimental" dimension called Landmark dimension. Imagine adding a dimension to some external point you dont have in your model, but know the coordinates. Following steps to reproduce:
1) create 2 or more Draft.PointObjects at different coordinates
2) create a dummy body to show in TechDraw
3) create a sheet, add a view of the body
4) select the view and the 2 points in the model tree and hit the landmark dimensioning tool (dimension is introduced).
Up until here, everything is fine. However, I want these points to have some custom property. So, in the Python Console I do:
5)
Code: Select all
App.ActiveDocument.Point.addProperty("App::PropertyString", "Position")
App.ActiveDocument.Point.Position = "MyFancyLocation"
6) change one of the coordinates, something breaks. I get an
Code: Select all
<Exception> Access violation
I am not completely sure, whether this also causes FreeCAD to shut down after my full macro, but at least it is something going wrong. Also the file seems to be broken after that, I cannot delete the landmarkDim object.
Looks like a bug to me. Any suggestions, remarks?
I attach the working example up until step 5. You can reproduce from there.
OS: Windows 10 (10.0)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24212 (Git)
Build type: Release
Branch: master
Hash: 3d227cf7179c00e57f2733f947b4b1b0368d219a
Python version: 3.8.8
Qt version: 5.12.5
Coin version: 4.0.0
OCC version: 7.4.0
Locale: German/Germany (de_DE)