[Macro] Bit of help for super users :)

Need help, or want to share a macro? Post here!
openBrain
Posts: 3087
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Fri Dec 06, 2019 9:23 am

Kunda1 wrote:
Thu Dec 05, 2019 6:32 pm
Are you sure it's out of scope? I ask because we could see this macro being used by beginners as well which we can eventually educate to use this macro to post their system info.
'Out of scope' means here that I don't consider it has to be an achievement before the macro can be released. ;)
User avatar
Kunda1
Posts: 6427
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Macro] Bit of help for super users :)

Post by Kunda1 » Fri Dec 06, 2019 2:56 pm

openBrain wrote:
Fri Dec 06, 2019 9:23 am
'Out of scope' means here that I don't consider it has to be an achievement before the macro can be released.
:+1: :)
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
openBrain
Posts: 3087
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Sun Dec 08, 2019 5:24 pm

Hi all,

Just updated the files at OP to introduce a new feature (probably my preferred one :P) : the visibility tool.
I appears beside other icons in the status bar, this one with a 'V' icon. It brings quite some features :
  • Left click : show selected object(s) and hide all others
  • Middle click : 'Fit all' view (equivalent to FC command)
  • Right click : show all objects
  • Mouse wheel : the first wheel notch will makes a slider to appear over the button. From here you can either continue to spin wheel with cursor on the button, or spin the wheel with cursor on the slider, or drag the slider button with mouse. This will change the transparency of selected object(s) (of all objects if nothing selected) by step of 5% in the 2 first cases, by step of 1% in the last one
There are on purpose limitations. Show/Hide/Transparency features applies only on Part containers, Part features, Body objects and Links. I.e. it won't change visibility/transparency of Origins, Sketches, PartDesign features, ... This isn't a problem as they follow the status of their parents (typically a Body or Part container). This means that if all PartDesign features of a Body has been hidden by user, the "Show all" function will make the Body visible but you'll see no shape as you previously hide them all.

Also probably there are bugs, but here I trust your feedback to patch them as they appear. Please provide example file when reporting issue(s).
chrisb
Posts: 21375
Joined: Tue Mar 17, 2015 9:14 am

Re: [Macro] Bit of help for super users :)

Post by chrisb » Sun Dec 08, 2019 7:14 pm

Does it load on start or is this independent from the script?
openBrain
Posts: 3087
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Sun Dec 08, 2019 7:31 pm

chrisb wrote:
Sun Dec 08, 2019 7:14 pm
Does it load on start or is this independent from the script?
Not sure to well understand but anyway. :)
If you want a manual launch, get the .py file at OP and store it in your user 'Macro' folder.
If you want an auto launch at startup, get the .zip file at OP and uncompress in your user 'Mod' folder (keep the subfolder included in the zip).
In any case, all tools will be available without more actions.

Edit : if you want only the visibility tool and not the others, you can easily tweak the 'run' function. ;)
chrisb
Posts: 21375
Joined: Tue Mar 17, 2015 9:14 am

Re: [Macro] Bit of help for super users :)

Post by chrisb » Sun Dec 08, 2019 10:24 pm

Thanks, got it loaded on startup.
openBrain
Posts: 3087
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Mon Dec 09, 2019 12:35 pm

chrisb wrote:
Sun Dec 08, 2019 10:24 pm
Thanks, got it loaded on startup.
:+1:
I'll now go to prepare this for distributing through Addon Manager. ;)

Still everybody, feel free to report bugs and suggest improvements.
chrisb
Posts: 21375
Joined: Tue Mar 17, 2015 9:14 am

Re: [Macro] Bit of help for super users :)

Post by chrisb » Wed Dec 11, 2019 5:14 am

The macro including auto start works very well - in 0.19. However, if I start 0.18 I get errors on startup:

Code: Select all

FC_SU macro is enabled
Traceback (most recent call last):
  File "<string>", line 8, in runMacro
  File "/Users/cb/Library/Preferences/FreeCAD/Mod/FC_SU/FC_SU.py", line 268, in run
    ctb = statusBarWid(custBar)
  File "/Users/cb/Library/Preferences/FreeCAD/Mod/FC_SU/FC_SU.py", line 174, in __init__
    lay.addWidget(butt[0](*butt[1], parent=self))
  File "/Users/cb/Library/Preferences/FreeCAD/Mod/FC_SU/FC_SU.py", line 47, in __init__
    act = QtGui.QAction(text)
TypeError: 'PySide2.QtWidgets.QAction' called with wrong argument types:
  PySide2.QtWidgets.QAction(str)
Supported signatures:
  PySide2.QtWidgets.QAction(PySide2.QtCore.QObject)
  PySide2.QtWidgets.QAction(PySide2.QtGui.QIcon, unicode, PySide2.QtCore.QObject)
  PySide2.QtWidgets.QAction(unicode, PySide2.QtCore.QObject)
Can this be avoided?
openBrain
Posts: 3087
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Wed Dec 11, 2019 9:13 am

chrisb wrote:
Wed Dec 11, 2019 5:14 am
The macro including auto start works very well - in 0.19. However, if I start 0.18 I get errors on startup:
Can this be avoided?
Probably it can. Could you post your 0.18 info so I know Qt and Python versions? But honestly I won't go for a huge compatibility effort if it's too much of a pain. ;)
openBrain
Posts: 3087
Joined: Fri Nov 09, 2018 5:38 pm

Re: [Macro] Bit of help for super users :)

Post by openBrain » Wed Dec 11, 2019 3:03 pm

chrisb wrote:
Wed Dec 11, 2019 5:14 am
Can this be avoided?
Should be fixed with new files at OP. ;)
Post Reply

Who is online

Users browsing this forum: spanner888 and 4 guests