Accurate and repeatable setting of F360 camera viewpoint - help?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi folks -
I'm trying to use a Python script in F360 to set the camera view. Have some basic experience with Python but not with API programming. So would greatly appreciate some help.
About a year ago "nick" asked about a script to get and set the camera viewpoint:
I have a similar need now and I tried the scripts that had been posted in that discussion. I want to define specific vews for documenation and reuse them for multiple drawings. Something like "30 deg right, 25 deg up, 0 deg roll". I ran into two problems:
1) The bug that was mentioned for "set camera" script - that the up-vector does not get set - is still here a year later. The up-axis of the model will not rotate to point up, A work around to get it point up is to first go to the home view and then run the script to set the camera view. I don't know if this can be done programatically.
2) Unfortunately F360 does not have any way to pick an exact view except for the predefined views. The only way to get other views (as far as I have found) is to drag with the mouse. This always results in some rotation of the up-vector (i.e. vertical model lines are off-vertical in the view) and no way to pick specific compass and elevation angles. In theory I could edit the information saved by the "save camera" script but I don't understand it. Three vectors are saved ("Eye", "target", and "upvector") but it is not clear what coordinate system they reference.
What I would really like is a dialog box where I could set the camera angle relative to the model coordinates. This would be similar to the vpoint command in Autocad. If the view could update with the dialog box open then with a little trial and error I could pick a nice view with angles at integer values instead of having many right-of-the-decimal-point digits. The values could be reused for other models. A graphical compass and elevation dialog like a modern version of Autocad would be nice but not really needed. Could the developers supply some equations to convert between the internal Eye/target/upvector vectors and more usable compass/elevation/roll vectors? Of course it would be nice to fix the upvector bug too.
I have suggested something like this in the IdeaStation area, but I didn't do a good job of convincing the community that it is important. So I would like to create a script to handle it. Oddly good old Autocad handles this really well while newer Solidworks has a marginal solution (using the arrow keys to rotate in fixed increments). I don't know Inventor but a quick Google search didn't turn up anything obvious.
Sorry for these ramblings. Any suggestions appreciated!