Jump to content

Adapt 3D view zoom/position in report pages by script


---
 Share

Recommended Posts

Hello,

 

I was wondering if there were any command to adapt the zoom and position in a 3D view? 

 

I am looking for something similiar to : gom.script.view.adjust_view_to_element_by_front_view. But that would allow me to control the centering and zooming of the corresponding 3D view.

 

Kind regards,

 

Benjamin

Link to comment
Share on other sites

Hello Benjamin,

there is a command gom.script.view.set_view_cartesian:

# Example
gom.script.view.set_view_cartesian(camera_position=gom.Vec3d(-100,0,0), view_direction=gom.Vec3d(0,1,0), up_direction=gom.Vec3d(0,0,-1))

print(gom.script.view.set_view_cartesian.__doc__)
view.set_view_cartesian (Record Current 3D View) - Set View (Cartesian)
 
Parameters:
 
Name            | Description                  | Type                         | Optional
----------------------------------------------------------------------------------------
camera_position | defines the camera position  | Core::Types::BaVec<3,double> | No      
view_direction  | defines the view direction   | Core::Types::BaVec<3,double> | No      
up_direction    | defines the up direction     | Core::Types::BaVec<3,double> | No      
scale           | defines the scale factor     | double                       | Yes     
use_animation   | defines the use of animation | bool                         | Yes     
widget          | defines the name of widget   | QString                      | Yes

 

Hope this helps!

Best regards,

Matthias

 

Link to comment
Share on other sites

^^ These hidden functions are gold. 

i've been using 
 

gom.script.view.set_xp_yp_zp (
up_axis='Z+', 
use_animation=False, 
widget='3d_view')

gom.script.view.adapt_zoom (use_animation=False)

gom.script.report.create_report_page...

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...