Screw Maker Macro

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
lemonbug
Posts: 310
Joined: Sun Oct 19, 2014 5:12 pm

Screw Maker Macro

Post by lemonbug »

Hi-

Does anyone have experience with the screw macro? I didn't want to email Ulrich directly and bother him.

I have used this in the past with no issues but I can't get my screw placement working now. I thought if I just selected the hole I wanted it would automatically add the screw there. However, in this case, it only adds it to the center.

thanks,

OS: Mac OS X
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.13519 (Git)
Build type: Release
Branch: (HEAD detached at 1a8b868)
Hash: 1a8b868018f45ea486c0023fdbfeb06febc1fb89
Python version: 2.7.14
Qt version: 5.10.1
Coin version: 4.0.0a
OCC version: 7.2.0
Locale: English/UnitedStates (en_US)
Attachments
11-25-18.FCStd
(78.02 KiB) Downloaded 47 times
Screen Shot 2018-11-26 at 12.02.24 PM.png
Screen Shot 2018-11-26 at 12.02.24 PM.png (212.52 KiB) Viewed 1647 times
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Re: Screw Maker Macro

Post by ulrich1a »

lemonbug wrote: Mon Nov 26, 2018 8:07 pm I have used this in the past with no issues but I can't get my screw placement working now. I thought if I just selected the hole I wanted it would automatically add the screw there. However, in this case, it only adds it to the center.
This is a really difficult problem for me. The version available in the Addon Manager was adapted to work under Mac OS X by galou_breizh. The Addon-Manager-version seems to have a problem to locate the screw but I can not find by a simple comparison, what caused this. My original version worked for me. See here for a link: https://forum.freecadweb.org/viewtopic. ... 00#p262859

Ulrich

Edit: The original version works only at selecting the top edge and not the inner cylinder.
lemonbug
Posts: 310
Joined: Sun Oct 19, 2014 5:12 pm

Re: Screw Maker Macro

Post by lemonbug »

Thanks. I made a new macro and pasted the text in there. This is the version I am using now from the link you provided. I tried clicking just the edge, nothing at all etc.

# screw_maker2_2.py
#


However, I get this error message. Is there something I did incorrectly when setting up the new macro? Thanks
Screen Shot 2018-11-26 at 4.26.45 PM.png
Screen Shot 2018-11-26 at 4.26.45 PM.png (97.29 KiB) Viewed 1613 times
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Screw Maker Macro

Post by NormandC »

Rather than post a screenshot of the bottom of your FreeCAD window, please make the report view visible (View --> Panels menu) then you'll be able to copy-paste the error message.

Have you tried the Fasteners add-on? If I recall correctly, it's based on Ulrich's Screw Maker macro. It creates parametric screws.
lemonbug
Posts: 310
Joined: Sun Oct 19, 2014 5:12 pm

Re: Screw Maker Macro

Post by lemonbug »

NormandC wrote: Tue Nov 27, 2018 2:10 am Rather than post a screenshot of the bottom of your FreeCAD window, please make the report view visible (View --> Panels menu) then you'll be able to copy-paste the error message.

Have you tried the Fasteners add-on? If I recall correctly, it's based on Ulrich's Screw Maker macro. It creates parametric screws.
Thanks, that was the one window I didn't try for some reason, I was picking through those for a while today wondering where it was. Also, I will take a look at the fasteners add-on tonight if I can.

Code: Select all

Traceback (most recent call last):
  File "/Users/brucewayne/Library/Preferences/FreeCAD/Macro/SM2.FCMacro", line 5461, in <module>
    class ScrewMacro(object):
  File "/Users/brucewayne/Library/Preferences/FreeCAD/Macro/SM2.FCMacro", line 5464, in ScrewMacro
    d.ui.setupUi(d)
  File "/Users/brucewayne/Library/Preferences/FreeCAD/Macro/SM2.FCMacro", line 1777, in setupUi
    self.retranslateUi(ScrewMaker)
  File "/Users/brucewayne/Library/Preferences/FreeCAD/Macro/SM2.FCMacro", line 1787, in retranslateUi
    ScrewMaker.setWindowTitle(QtGui.QApplication.translate("ScrewMaker", "Screw-Maker 2.2", None, QtGui.QApplication.UnicodeUTF8))
<type 'exceptions.AttributeError'>: type object 'PySide2.QtWidgets.QApplication' has no attribute 'UnicodeUTF8'
lemonbug
Posts: 310
Joined: Sun Oct 19, 2014 5:12 pm

Re: Screw Maker Macro

Post by lemonbug »

Wow, fasteners WB is amazing! Got that working. But just curious at this point if someone sees what I did wrong off-hand.
User avatar
NormandC
Veteran
Posts: 18589
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: Screw Maker Macro

Post by NormandC »

lemonbug wrote: Tue Nov 27, 2018 3:33 am File "/Users/brucewayne
Wow! Didn't know we had such lofty people on the forum.

Dog prosthetic maker by day, billionaire playboy by night, doesn't leave you much time for vigilante work! :mrgreen:
lemonbug
Posts: 310
Joined: Sun Oct 19, 2014 5:12 pm

Re: Screw Maker Macro

Post by lemonbug »

Oops, forgot to redact that : )
chrisb
Veteran
Posts: 54140
Joined: Tue Mar 17, 2015 9:14 am

Re: Screw Maker Macro

Post by chrisb »

lemonbug wrote: Tue Nov 27, 2018 3:33 am Thanks, that was the one window I didn't try for some reason
I have added code tags </> to the output listing. Makes it easier to read and keeps the indentation.
A Sketcher Lecture with in-depth information is available in English, auf Deutsch, en français, en español.
Post Reply