Navigation style

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
Guest

Navigation style

Post by Guest »

Hi,

Is there any possibility to change navigation style(inventor/CAD) from python console, instead of right click menu? or to bind a keyboard shortcut to it

thnx
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Navigation style

Post by wmayer »

Currently, this is not possible. With the latest revision I have implemented it to allow it from python. The methods are:

Code: Select all

view=Gui.ActiveDocument.ActiveView
view.listNavigationTypes() -> all possible styles (at the moment two)
view.getNavigationType() -> current style
view.setNavigationType(string) -> set style name as string in argument 
Guest

Re: Navigation style

Post by Guest »

is not working. none of these api..

Code: Select all

>>> view=Gui.ActiveDocument.ActiveView
>>> view.listNavigationTypes()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: listNavigationTypes
>>> view.listNavigationTypes()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: listNavigationTypes
>>> view.getNavigationType()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: getNavigationType
>>> view.setNavigationType(string)
Traceback (most recent call last):
  File "<input>", line 1, in <module>
AttributeError: setNavigationType
 
apparently they are not implemented. i use 0.11 for windows from sourceforge
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Navigation style

Post by wmayer »

As I said:
Currently, this is not possible. With the latest revision I have implemented it to allow it from python. The methods are:
You have to wait for the next release of our 0.12 unstable version.
wmayer
Founder
Posts: 20309
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Navigation style

Post by wmayer »

But what you can already do is writing the according value to the preferences in python which sets the style for all 3d views.

Code: Select all

p=App.ParamGet("User parameter:BaseApp/Preferences/View")
p.SetString("NavigationStyle","Gui::InventorNavigationStyle")
p.SetString("NavigationStyle","Gui::CADNavigationStyle")
Post Reply