how to control grid behaviour?

Need help, or want to share a macro? Post here!
User avatar
teobo
Posts: 405
Joined: Fri Feb 21, 2014 11:23 am

Re: how to control grid behaviour?

Postby teobo » Sat May 24, 2014 4:25 pm

yorik wrote:Inside the python code, you can use FreeCADGui.doCommand() to print & execute code in the python window. If you search in Draft and Arch modules it is used everywhere. That command is defined IIRC in src/Gui/Applicationpy.cpp

But in the C++ code there are two methods, one for App commands and another for Gui commands. This is important because the macro recording stuff must be able to differentiate. So the first thing that must be done is implement a doGuiCommand() or something like that in C++, then use it in python code for Gui operations.
Thank that will do.

The transitions from cpp to python or reverse I can not yet oversee. Is it that _all_ missing docommand feature is due to the rather more complex issue of your second paragraph?
What is about for example with toggle Grid menu entry;does it points to cpp or to python code?
Tia
User avatar
yorik
Site Admin
Posts: 11371
Joined: Tue Feb 17, 2009 9:16 pm
Location: São Paulo, Brazil
Contact:

Re: how to control grid behaviour?

Postby yorik » Sat May 24, 2014 4:43 pm

Yes. Once that command is done, we can simply convert the needed code using FreeCADGui.doGuiCommand().
I openend an issue on the tracker for this: issue #1564
User avatar
teobo
Posts: 405
Joined: Fri Feb 21, 2014 11:23 am

Re: how to control grid behaviour?

Postby teobo » Sat May 24, 2014 7:03 pm

Ok, then mtost lately I will see in the diffs what was needed to change that.
User avatar
teobo
Posts: 405
Joined: Fri Feb 21, 2014 11:23 am

Re: how to control grid behaviour?

Postby teobo » Thu Jun 05, 2014 9:37 am

Add python function for GUI verison of Command::doCommand
I must state that I do not understand that very well. Sound like freecad internal.

And would like to add that even more importantly the workplane dialog needed a docommand print out, - as often during the work with the gui crashes and then one had ad least fixed the procedure by scripting. And it makes the work easy and controlled, if one can assign - on the fly - a defined workplane.