Fasteners workbench based on screw-maker

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
dwizeno
Posts: 18
Joined: Fri Jun 26, 2015 5:55 am

Re: Fasteners workbench based on screw-maker

Post by dwizeno »

shaise wrote: ....I was also thinking of something similar to a boring tool, I will add it to my list. Hopefully this time it will take less time to code...
I sure would love to be able to use part boring via fastener workbench.
- Align two or even stack several parts in which at least some do not yet have appropriate holes.
- Place a screw in regular manner but give option to generate (through-) holes.
- Generated hole diameters & depth (through-hole or not) may be deducible from bolt/screw type geometry.
Kauli
Posts: 5
Joined: Wed Feb 17, 2016 8:20 am

Re: Fasteners workbench based on screw-maker

Post by Kauli »

Hi shaise,

At first thanks for the wonderful Job you and all the others are doing for the whole community !!!
I love unsing FreeCad.

I have two questions.

First.
Is it possible to add Din 912 and Din 6912 ?
Or is there any way i can add these or other Screwtypes by myself ?

Second.
Is it possible for me to change the Fastener Names/Terms in German Text.

Thank you in advance for your answer
Kauli
Last edited by Kauli on Wed Feb 17, 2016 9:59 am, edited 4 times in total.
jmaustpc
Veteran
Posts: 11207
Joined: Tue Jul 26, 2011 6:28 am
Location: Australia

Re: Fasteners workbench based on screw-maker

Post by jmaustpc »

your first post, welcome to FreeCAD. :)
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: Fasteners workbench based on screw-maker

Post by shaise »

Kauli wrote: I have two questions.

First.
Is it possible to add Din 912 and Din 6912 ?
Or is there any way i can add these or other Screwtypes by myself ?

Second.
Is it possible for me to change the Fastener names Terms in German Text.
Hi Kauli,

First of all, all the fasteners where not made by me. They ware made by Ulrich1 with his Screw-Maker script. I just made it more accessible with a workbench rather then script activation.
To add new screws to the script, you need some python scripting knowledge, and you can try and modify the files in the workbench. All screw generation is under the screwMaker file.
You can also change the names to German, there.
When you finish, if you feel it can help others, you can share your work using this forum.

Good luck!
Kauli
Posts: 5
Joined: Wed Feb 17, 2016 8:20 am

Re: Fasteners workbench based on screw-maker

Post by Kauli »

THX shaise for your fast reply.

So i may have to ask Ulrich1 for some Tipps to my first question (adding new Srewtypes).
Is there an extra Thread for Screw-maker and Ulrich1's great work ??

To rename them to German i think change the item text should be all..?

Here an example what i think about
Line 222 in FastenersCmd.py
FSAddScrewCommand("ISO4017", "ISO 4017 Hex head screw", "Hex head")
only change to
FSAddScrewCommand("ISO4017", "ISO 4017 Sechskantschrauben mit Schaft", "Hex head")

Can i do such "operations" in my System ?
or is here anything could go into a Desaster.. :P

i don 't want to compile new or something...
only change text in the unzipped Files

Kauli
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: Fasteners workbench based on screw-maker

Post by shaise »

Kauli wrote:THX shaise for your fast reply.

To rename them to German i think change the item text should be all..?

i don 't want to compile new or something...
only change text in the unzipped Files

Kauli
Hi Kauli
Yes! it is that simple.
This is the beauty of FreeCad workbench system.
Only a good text editor and that is all (the free notepad++ is recommended).
Try it. No need of compilation or anything.

shai
Kauli
Posts: 5
Joined: Wed Feb 17, 2016 8:20 am

Re: Fasteners workbench based on screw-maker

Post by Kauli »

Hello Shai,
ist is me once again ........

In your "InitGui.py" you have created an Icon in XPM Code.

Is it possible to modify the code to load an Icon from the Icon path (maybe Fasteners.svg) ?
i know it is a doddle but i have a nice one and i don't know how to embed........
Icon.JPG
Icon.JPG (8.25 KiB) Viewed 2843 times
making an *.svg from the *.jpg with Inkscape is no prob...
Can you give me any hints ?

THX
Kauli
User avatar
shaise
Posts: 486
Joined: Thu Jun 11, 2015 8:11 am

Re: Fasteners workbench based on screw-maker

Post by shaise »

Kauli wrote: Is it possible to modify the code to load an Icon from the Icon path (maybe Fasteners.svg) ?
i know it is a doddle but i have a nice one and i don't know how to embed........
Hi Kauli,

As far as I know, initGui.py can accept only XPM Icons. You can use The Gimp to convert you icon to XPM

shai
User avatar
wandererfan
Veteran
Posts: 6317
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: Fasteners workbench based on screw-maker

Post by wandererfan »

shaise wrote:As far as I know, initGui.py can accept only XPM Icons. You can use The Gimp to convert you icon to XPM
Hamish does it this way in DrawingDimensioning:

Code: Select all

class DrawingDimensioningWorkbench (Workbench):
    Icon = ':/dd/icons/linearDimension.svg'
    MenuText = 'Drawing Dimensioning'
wf
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Fasteners workbench based on screw-maker

Post by triplus »

Yes i encourage developers to start using SVG instead of XPM format for workbench icon purposes.

Two reasons i have:
  • Higher quality
  • XPM icons are usually in 16x16 size and therefore can't be scaled up if needed
As on how i plan to do it in master. I will try to follow this convention:

viewtopic.php?f=10&t=10497&start=10#p97607

But now i see for 3rd Party Modules this might not be the best approach. As this for example:

Code: Select all

    def __init__(self):
        self.__class__.Icon = FreeCAD.getResourceDir() + "Mod/Fasteners/Resources/icons/FastenersWorkbench.svg"
        self.__class__.MenuText = "Fasteners"
        self.__class__.ToolTip = "Create ISO Fasteners"
Has at least 2 obvious shortcomings:
  • Module folder name needs to be Fasteners or it won't work.
  • This only works if module is installed in system wide directory as another option that needs to be supported is (FreeCAD.getUserAppDataDir()) local folder.
Post Reply