Hi, thanks, for the advice.
Do you think that we could target 0.20 as minimun FC version or the problem with 0.19 is limited to the clearDocument() and we can find a workaround for it, and target 0.20.
Any other hints?
Regards
Carlo D.
Hi, thanks, for the advice.
Many thanks for the reply.Roy_043 wrote: ↑Thu Oct 13, 2022 3:21 pm Your code is based on fixed object names, that is why you need doc.clearDocument(). Else the code cannot be run in the same document twice. I have already made a comment about that (https://forum.freecadweb.org/viewtopic.php?f=22&t=72207). I would not use this approach.
...
For this problem, probably some other modification has to be done to make a proper results, other than delecting the lines?
I would not save the document at all. To me it is only annoying when a program saves a document to a location that I am unaware of. Why not just create a new document and leave it to the user if, and where, they want to save it.
Actually deleting the 5 lines works. But, as already indicated, without doc.clearDocument() the code cannot be run twice in the same document.
Ok now it is more clear, I've been reusing a code, that replicate an Assembly4 tutorial that needs to save and reopen files.
I will try to find and alternative.
Hello, try this modified file.
Code: Select all
OS: Windows 8.1 Version 6.3 (Build 9600)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.24267 +148 (Git)
Build type: Release
Branch: Branch_0.19.4
Hash: 476ecf091941bead59b14e44afa6064d5a66afa3
Python version: 3.8.6+
Qt version: 5.15.2
Coin version: 4.0.1
OCC version: 7.5.3
Locale: Dutch/Netherlands (nl_NL)