Camera Settings within ACT Extension

Ayush Kumar
Ayush Kumar Member, Moderator, Employee Posts: 449
250 Likes Solution Developer Community of Practice Member Ansys Employee First Anniversary
✭✭✭✭
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
    Photogenic First Comment 5 Likes Solution Developer Community of Practice Member
    ✭✭✭✭
    Answer ✓

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