Load EditableTexts in Drawing
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Load EditableTexts in Drawing
https://github.com/ianrrees/FreeCAD_tin ... ee/fix2064 has a potential solution for http://www.freecadweb.org/tracker/view.php?id=2064 . I think there's probably a better way to do it, but don't want to put too much work into the old Drawing .
If it'a possible to suppress the call to FeaturePage::onChanged() at the end of FeaturePage::onDocumentRestored(), that might be better? -Ian-
If it'a possible to suppress the call to FeaturePage::onChanged() at the end of FeaturePage::onDocumentRestored(), that might be better? -Ian-
Re: Load EditableTexts in Drawing
Why is this topic archived?
Re: Load EditableTexts in Drawing
Dunno - it's entirely possible that I put it here by accident... -Ian-
Re: Load EditableTexts in Drawing
According to the moderator logs there has been moved only one post to the archive and this was about the PropertyEnumeration. So, I guess this post must have been created here. I'll move it to the Developers corner.
Re: Load EditableTexts in Drawing
Does anyone have a better idea of how to fix issue 2064, or should this one be merged? Thanks! -Ian-
Re: Load EditableTexts in Drawing
The isRestoring() method queries a certain bit from the StatusBits bitset and this is set before calling a feature's Restore() method and unset afterwards. So, inside your onDocoumentRestored() method you can call "StatusBits.set(4);" at the beginning and "StatusBits.reset(4);" at the end.The old check for !isRestoring() in FeaturePage::onChanged() doesn't work as intended, because by the point that onDocumentRestored() is called, isRestoring() returns false.
Re: Load EditableTexts in Drawing
OK, I tried it and it works pretty well: git commit 74c912f
Re: Load EditableTexts in Drawing
Cool, thanks! -Ian-
Re: Load EditableTexts in Drawing
I compiled FreeCAD today and tested:
I can confirm edited text does not get replaced anymore. Thanks for fixing this. Issue 2064 therefore is fixed. In other thread i mentioned one more consequence i found regarding changes introduced in issue report 1963:
- Insert drawing template. Original Template
- Change drawing template (Property Template). Changed Template
- Save the FreeCAD document.
Inside .fcstd file Changed Template will be saved but it will have Original Template file name. Trying to edit titleblock text after FreeCAD restart will therefore result in loading default Original Template. Should i make new issue report?
I can confirm edited text does not get replaced anymore. Thanks for fixing this. Issue 2064 therefore is fixed. In other thread i mentioned one more consequence i found regarding changes introduced in issue report 1963:
- Insert drawing template. Original Template
- Change drawing template (Property Template). Changed Template
- Save the FreeCAD document.
Inside .fcstd file Changed Template will be saved but it will have Original Template file name. Trying to edit titleblock text after FreeCAD restart will therefore result in loading default Original Template. Should i make new issue report?
Re: Load EditableTexts in Drawing
Yeah, probably a good idea to make a new ticket for this. I'm personally going to try and stay focused on the new Drawing, which I think will handle this situation differently by design. -Ian-triplus wrote:Inside .fcstd file Changed Template will be saved but it will have Original Template file name. Trying to edit titleblock text after FreeCAD restart will therefore result in loading default Original Template. Should i make new issue report?