Automatically create body?
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Automatically create body?
OK, only had a couple brief periods to look at this today, but think I've got it mostly sorted.
One more question though: I need to get a chunk of code to run if the PartDesignGui::TaskDlgFeaturePick() at the end of CmdPartDesignNewSketch::activated() is cancelled, to delete the Body that was created. Can't see an easy way to do that within the current framework, is there something I'm missing? -Ian-
One more question though: I need to get a chunk of code to run if the PartDesignGui::TaskDlgFeaturePick() at the end of CmdPartDesignNewSketch::activated() is cancelled, to delete the Body that was created. Can't see an easy way to do that within the current framework, is there something I'm missing? -Ian-
Re: Automatically create body?
OK, does the current PR https://github.com/FreeCAD/FreeCAD/pull/667 look alright?
There is some weirdness with Redo, at least on my machine (Qt5.6, OSX) - the axes and planes end up outside the Body, but that happens on master too. Otherwise it seems well behaved so far. -Ian-
There is some weirdness with Redo, at least on my machine (Qt5.6, OSX) - the axes and planes end up outside the Body, but that happens on master too. Otherwise it seems well behaved so far. -Ian-
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Automatically create body?
I scrolled through the changes, looks good to me.
A small hint. Parts and Bodies have a method "newObject" that combines creation and addition into one operation. But the major transplantation of all calls to App.ActiveDocument.addObject within whole freecad can be expected in not too distant future anyway.
A small hint. Parts and Bodies have a method "newObject" that combines creation and addition into one operation. But the major transplantation of all calls to App.ActiveDocument.addObject within whole freecad can be expected in not too distant future anyway.
Re: Automatically create body?
Create Body > Undo > Redo then then the items are outside. Once you expand the body and origin the items jump back to the correct parent. I can confirm this on Linux and Windows and it might be caused by the modifications for the tree view.ian.rees wrote:There is some weirdness with Redo, at least on my machine (Qt5.6, OSX) - the axes and planes end up outside the Body, but that happens on master too. Otherwise it seems well behaved so far. -Ian-
- DeepSOIC
- Veteran
- Posts: 7896
- Joined: Fri Aug 29, 2014 12:45 am
- Location: used to be Saint-Petersburg, Russia
Re: Automatically create body?
I also observe it in: OS: Windows 10wmayer wrote:Create Body > Undo > Redo then then the items are outside. Once you expand the body and origin the items jump back to the correct parent. I can confirm this on Linux and Windows and it might be caused by the modifications for the tree view.
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.9933 (Git)
Build type: Release
Branch: master
Hash: 6c3b78e97bbb8653e1189038c99682becef71626
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
EDIT: but recovering correct layout is much harder
I also experienced similar problem in early days of part-o-magic, when I added stuff to containers from slotCreateObject(). So I would guess it has something to do with lacking viewproviders or something...
Re: Automatically create body?
Found an interesting bug:
1. New document
2. New sketch
3. Undo
4. Select an item and press OK
The OK & Cancel button disappears but the panel is still there. There is no way to get rid of the panel you must quit FreeCAD.
But this bug was already there and hasn't been introduced by this PR.
1. New document
2. New sketch
3. Undo
4. Select an item and press OK
The OK & Cancel button disappears but the panel is still there. There is no way to get rid of the panel you must quit FreeCAD.
But this bug was already there and hasn't been introduced by this PR.
Re: Automatically create body?
Ahh, thanks for that! Will keep that in mind for next time around. -Ian-DeepSOIC wrote:I scrolled through the changes, looks good to me.
A small hint. Parts and Bodies have a method "newObject" that combines creation and addition into one operation. But the major transplantation of all calls to App.ActiveDocument.addObject within whole freecad can be expected in not too distant future anyway.
Re: Automatically create body?
Interesting. I can try to look at that this evening if you haven't already found a fix.wmayer wrote:Found an interesting bug:
1. New document
2. New sketch
3. Undo
4. Select an item and press OK
The OK & Cancel button disappears but the panel is still there. There is no way to get rid of the panel you must quit FreeCAD.
But this bug was already there and hasn't been introduced by this PR.
Re: Automatically create body?
Here is a fix git commit bf54226. The TaskFeaturePick class now also inherits from DocumentObserver and reimplements two methods to close itself on undo when needed.ian.rees wrote:Interesting. I can try to look at that this evening if you haven't already found a fix.wmayer wrote:Found an interesting bug:
1. New document
2. New sketch
3. Undo
4. Select an item and press OK
The OK & Cancel button disappears but the panel is still there. There is no way to get rid of the panel you must quit FreeCAD.
But this bug was already there and hasn't been introduced by this PR.
Re: Automatically create body?
Tested the behaviour and without the pop-up the experience is much better.