Command type in python

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Command type in python

Post by carlopav »

I'd like to use the command manager addCommand() to produce a checkable toolbar button in python.
Is there any documentation to do it automagically passing some extra arguments to addCommand?

Edit: something like Std_TreeSyncView
follow my experiments on BIM modelling for architecture design
User avatar
bernd
Veteran
Posts: 12851
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland
Contact:

Re: Command type in python

Post by bernd »

AFAIK the Draft snap tools do what you look for and they are done in Python AFAIK.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: Command type in python

Post by carlopav »

The Draft toolbars are kinda "non standard"ncause they are added and controller directly by Draft wb.
I was asking myself if there Is an option to produce a checkable QtAction when adding a command, to reduce code duplication...
follow my experiments on BIM modelling for architecture design
Post Reply