Volunteers: Unfinished Wiki pages for Part Workbench

Discussions about the wiki documentation of FreeCAD and its translation.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
C4e
Posts: 324
Joined: Thu Jan 20, 2022 9:31 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by C4e »

I inserted a couple of tested scripting examples and found some interesting things.

Sometimes the counting variable names are not equal. Angle1, Angle2 or Angle0 and so on. Is there a rule of thumb for coding (always start at a counter of 0) oder what else?

Some of the Parameters do not have tool tip texts or identical tool tip text, which is not helpful in my opinion.

Can I make a Github PR to fill in this, or should this be discussed in the developer forum first?

And the question is, should I make a screenshot of the scripting result after the scripting section?
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by Kunda1 »

C4e wrote: Mon Feb 07, 2022 5:13 pm Can I make a Github PR to fill in this, or should this be discussed in the developer forum first?
I suggest to open a new forum thread in the developer discussion forum and x-post the link back to here.
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
C4e
Posts: 324
Joined: Thu Jan 20, 2022 9:31 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by C4e »

Kunda1 wrote: Mon Feb 07, 2022 8:02 pm
C4e wrote: Mon Feb 07, 2022 5:13 pm Can I make a Github PR to fill in this, or should this be discussed in the developer forum first?
I suggest to open a new forum thread in the developer discussion forum and x-post the link back to here.
Done.

The topic is here.
C4e
Posts: 324
Joined: Thu Jan 20, 2022 9:31 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by C4e »

Kunda1 wrote: Mon Jan 31, 2022 3:38 pm Per https://wiki.freecadweb.org/index.php?t ... nishedDocu
the following Part WB wiki pages are marked incomplete:
Part BoxSelection
...
Part Wedge
Please insert Part Prism to your list. I marked it as incomplete.
Last edited by Kunda1 on Tue Feb 08, 2022 9:44 pm, edited 1 time in total.
Reason: correct wiki link
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by Kunda1 »

C4e wrote: Tue Feb 08, 2022 7:59 pm Please insert Part Prism to your list. I marked it as incomplete.
Done, thanks!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
C4e
Posts: 324
Joined: Thu Jan 20, 2022 9:31 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by C4e »

Please insert Part_Tube to your list.

The scripting sections contains the following not workin line of code.

Code: Select all

tube = FreeCAD.ActiveDocument.addObject("Part::Tube", "myTube")
I tried this in the 0.20 version

OS: macOS 10.16
Word size of FreeCAD: 64-bit
Version: 0.20.27319 (Git)
Build type: Release
Python version: 3.9.10
Qt version: 5.12.9
Coin version: 4.0.0
OCC version: 7.5.3
Locale: C/Default (C)

And the result is

Code: Select all

File "<input>", line 1, in <module>
TypeError: 'Part::Tube' is not a document object type
I try to find it out and got some questions.

Both code examples occurs after pressing a button in the toolbar.

What is the difference between the following two code lines?

Code: Select all

Gui.runCommand('Part_Tube',0)
Starts a macro or code?

Code: Select all

App.ActiveDocument.addObject("Part::Cone","Cone")
User avatar
Roy_043
Veteran
Posts: 8546
Joined: Thu Dec 27, 2018 12:28 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by Roy_043 »

C4e wrote: Thu Feb 10, 2022 9:05 pm difference between the following two code lines?
The first starts a GUI command and cannot be used in a macro.

Looking at CommandShapes.py this is how you can add a tube:

Code: Select all

from BasicShapes import Shapes
from BasicShapes import ViewProviderShapes

tube = FreeCAD.ActiveDocument.addObject("Part::FeaturePython", "Tube")
Shapes.TubeFeature(tube)
ViewProviderShapes.ViewProviderTube(tube.ViewObject)
User avatar
Roy_043
Veteran
Posts: 8546
Joined: Thu Dec 27, 2018 12:28 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by Roy_043 »

C4e wrote: Sun Feb 06, 2022 1:33 pm Is the Properties section of the Part Box wiki page a good example?
I have updated Part_Box#Properties to how it should look.
User avatar
Kunda1
Veteran
Posts: 13434
Joined: Thu Jan 05, 2017 9:03 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by Kunda1 »

Nice!
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
C4e
Posts: 324
Joined: Thu Jan 20, 2022 9:31 pm

Re: Volunteers: Unfinished Wiki pages for Part Workbench

Post by C4e »

Roy_043 wrote: Thu Feb 10, 2022 9:34 pm The first starts a GUI command and cannot be used in a macro.

Looking at CommandShapes.py this is how you can add a tube:
Thanks for the hint to the CommandShapes.py. I should take a look into it. The meaning of GUI command and the difference will become now clear.

I will add the script into the wiki.
Roy_043 wrote: Thu Feb 10, 2022 10:07 pm I have updated Part_Box#Properties to how it should look.
Thanks. I will come back to it later.
Post Reply