ShaftDesign not fully functional on v0.20

About the development of the Part Design module/workbench. PLEASE DO NOT POST HELP REQUESTS HERE!
User avatar
johnwang
Veteran
Posts: 1098
Joined: Sun Jan 27, 2019 12:41 am

Re: ShaftDesign not fully functional on v0.20

Post 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
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
johnwang
Veteran
Posts: 1098
Joined: Sun Jan 27, 2019 12:41 am

Re: ShaftDesign not fully functional on v0.20

Post 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
Last edited by johnwang on Wed Jun 01, 2022 11:39 am, edited 1 time in total.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
uwestoehr
Veteran
Posts: 4281
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: ShaftDesign not fully functional on v0.20

Post 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?
adrianinsaval
Veteran
Posts: 3155
Joined: Thu Apr 05, 2018 5:15 pm

Re: ShaftDesign not fully functional on v0.20

Post 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?
User avatar
johnwang
Veteran
Posts: 1098
Joined: Sun Jan 27, 2019 12:41 am

Re: ShaftDesign not fully functional on v0.20

Post 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 457 times
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
uwestoehr
Veteran
Posts: 4281
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: ShaftDesign not fully functional on v0.20

Post 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'
User avatar
johnwang
Veteran
Posts: 1098
Joined: Sun Jan 27, 2019 12:41 am

Re: ShaftDesign not fully functional on v0.20

Post 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.
hfc series CAE workbenches for FreeCAD (hfcNastran95, hfcMystran, hfcFrame3DD, hfcSU2 and more)
User avatar
uwestoehr
Veteran
Posts: 4281
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: ShaftDesign not fully functional on v0.20

Post 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.
user1234
Veteran
Posts: 1697
Joined: Mon Jul 11, 2016 5:08 pm

Re: ShaftDesign not fully functional on v0.20

Post 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
User avatar
uwestoehr
Veteran
Posts: 4281
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany

Re: ShaftDesign not fully functional on v0.20

Post 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.
Post Reply