Camera Settings within ACT Extension

Options
Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 409
First Anniversary Ansys Employee Solution Developer Community of Practice Member First Answer
edited June 2023 in Structures
    camera = Graphics.Camera
    camera.FocalPoint = Point([0.255500, -0.002500, 0.000000], 'm')
    camera.ViewVector = Vector3D(0.000000, 0.000000, 1.000000)
    camera.UpVector = Vector3D(0.000000, 1.000000, 0.000000)
    camera.SceneHeight = Quantity(0.327739, 'm')
    camera.SceneWidth = Quantity(0.624862, 'm')
    camera.Rotate(30, CameraAxisType.ScreenY)
    camera.Rotate(30, CameraAxisType.ScreenX)
    camera.SetFit()

The above mentioned code within ACT Console works perfectly fine, however when used within an extension, I get the following error:

File "C:\Program Files\ANSYS Inc\v201\ACT\extensions\DropTestReport\main.py", line 14, in main 
AttributeError: 'type' object has no attribute 'Camera'
Tagged:

Answers

  • Chemsdine CHEMAI
    Chemsdine CHEMAI Member, Employee Posts: 201
    First Anniversary Ansys Employee Solution Developer Community of Practice Member 5 Likes
    Answer ✓
    Options

    Can you try to use the full path i.e: camera = ExtAPI.Graphics.Camera