I manually found a "custom" view on the GUI that i like for a bunch of parts i created with a script. If i save the result to a FreeCAD file then I get this custom view automatically when opening the file.
How can i extract this view information from FreeCAD to put in my script so that anyone using the script alone will get this same custom view on the GUI?
Setting view direction from within script
Forum rules
and Helpful information
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!
Also, be nice to others! Read the FreeCAD code of conduct!
-
- Posts: 439
- Joined: Tue Apr 04, 2017 6:06 pm
- Location: SF Bay Area, California
Re: Setting view direction from within script
With you get a string representation of the camera settings and with you can set it again.
Code: Select all
customView = Gui.ActiveDocument.ActiveView.getCamera()
Code: Select all
Gui.ActiveDocument.ActiveView.setCamera(customView)
-
- Posts: 439
- Joined: Tue Apr 04, 2017 6:06 pm
- Location: SF Bay Area, California