Page 2 of 3

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 8:55 am
by johnwang
adrianinsaval wrote: Tue May 31, 2022 9:36 pm @uwestoehr thoughts? seems it doesn't work out of the box and might be a bad idea to use it anyways, should we remove the shaft design wizard?
Here is kind the reason why it is not working. Because PLOT changed.

https://forum.freecadweb.org/viewtopic. ... ac#p598938

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 10:24 am
by johnwang
Kuzma30 wrote: Wed Jun 01, 2022 5:41 am
Figured out another way to fix.
Plot WB is no longer needed. Its function is moved into FC core.
Change to FreeCAD.Plot like this to access the new FC core plot function:

Code: Select all

class Diagram:
    def create(self, title, function, xlength, xname, xunit, xscale, yname, yunit, yscale, numxpoints):
        # Initialize
        from FreeCAD.Plot import Plot

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 11:25 am
by uwestoehr
Kuzma30 wrote: Wed Jun 01, 2022 5:41 am Than make it plot diagram.
It has a bug we must fix, yes. I hope that a Pyhtionist like @chennes can help me here since I have much to do with the release.

The bug I get is

Code: Select all

File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\WizardShaft.py", line 117, in slotQz
13:19:22      self.showDiagram("Qz")
13:19:22    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\WizardShaft.py", line 97, in showDiagram
13:19:22      self.shaft.showDiagram(diagram)
13:19:22    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\Shaft.py", line 223, in showDiagram
13:19:22      self.diagrams[self.F[ax].name].close()
13:19:22    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\ShaftDiagram.py", line 88, in close
13:19:22      self.win.parent().close()
13:17:45    AttributeError: 'Diagram' object has no attribute 'win'
To reproduce
- in the PD workbench go to menu Part Design -> Shaft design wizard
- in the appearing dialog click on the button "Q [z]"
- in case the Plot WB is not yet installed you are prompted to do so (then restart FC and repeat the first step)

Sometimes I have the general error that I am told the Plot WB is not installed and I should do so using the Addon-Manager. This is now since FC 0.20. @chennes can you please have a look if there is maybe a wrong config file?

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 11:29 am
by adrianinsaval
johnwang wrote: Wed Jun 01, 2022 10:24 am Figured out another way to fix.
Plot WB is no longer needed. Its function is moved into FC core.
Change to FreeCAD.Plot like this to access the new plot function:

Code: Select all

class Diagram:
    def create(self, title, function, xlength, xname, xunit, xscale, yname, yunit, yscale, numxpoints):
        # Initialize
        from FreeCAD.Plot import Plot
Can you make a PR?

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 11:36 am
by johnwang
adrianinsaval wrote: Wed Jun 01, 2022 11:29 am Can you make a PR?
I'm not good at it. If someone like and convenient, he can. I don't need that credit.

Here is the screenshot with the FC core Plot. No Plot WB is needed.
new shear.jpg
new shear.jpg (92.26 KiB) Viewed 1693 times

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 11:42 am
by uwestoehr
johnwang wrote: Wed Jun 01, 2022 10:24 am Figured out another way to fix.
I tried this but I still get this error:

Code: Select all

13:41:44  Traceback (most recent call last):
13:41:44    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\WizardShaft.py", line 117, in slotQz
13:41:44      self.showDiagram("Qz")
13:41:44    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\WizardShaft.py", line 97, in showDiagram
13:41:44      self.shaft.showDiagram(diagram)
13:41:44    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\Shaft.py", line 223, in showDiagram
13:41:44      self.diagrams[self.F[ax].name].close()
13:41:44    File "D:\FreeCAD-build\Mod\PartDesign\WizardShaft\ShaftDiagram.py", line 64, in close
13:41:44      self.win.parent().close()
13:41:44  AttributeError: 'Diagram' object has no attribute 'win'

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 11:49 am
by johnwang
uwestoehr wrote: Wed Jun 01, 2022 11:42 am I tried this but I still get this error:
I don't have these errors. I don't have Plot WB on my pc.

Try remove Plot WB if you have.

Edit: I think I saw the same error with the 1st way of fix.

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 11:57 am
by uwestoehr
johnwang wrote: Wed Jun 01, 2022 11:49 am Try remove Plot WB if you have.
I removed it and restarted FC but the error persists.

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 2:14 pm
by user1234
uwestoehr wrote: Wed Jun 01, 2022 2:07 am
adrianinsaval wrote: Tue May 31, 2022 9:36 pm @uwestoehr thoughts? seems it doesn't work out of the box and might be a bad idea to use it anyways, should we remove the shaft design wizard?
Not for 0.20, it will stay for now.
I would say that. Maybe a very dirty solution, remove the menu entry?


Greetings
user1234

Re: ShaftDesign not fully functional on v0.20

Posted: Wed Jun 01, 2022 2:15 pm
by uwestoehr
uwestoehr wrote: Wed Jun 01, 2022 11:57 am I removed it and restarted FC but the error persists.
Seems I had something cached somewhere. Now it works and I committed the fix:
https://github.com/FreeCAD/FreeCAD/commit/2de25dd04e

@Kuzma30 , please test if this works for you as well now.