How to change the camera position by AutoCAD API

How to change the camera position by AutoCAD API

kite15
Advocate Advocate
485 Views
1 Reply
Message 1 of 2

How to change the camera position by AutoCAD API

kite15
Advocate
Advocate

Hi,

I am trying to change the camera position to control the view cube wheel. Is there any process or method by which it can be possible?

Snap for better understanding...

 

ChangeCameraPosition.png

 

Mainly, I have seen while manually, rotate the view cube wheel the camera position has been changed.

My requirement is to set the camera position.

 

Tried with a camera class and there are get options only..

kite15_0-1651150351108.png

 

 

Please, help...

0 Likes
486 Views
1 Reply
Reply (1)
Message 2 of 2

hippe013
Advisor
Advisor

You can set the location of the camera using the AcadObject property of the camera object. 

 

Using tr As Transaction = db.TransactionManager.StartTransaction
    Dim cam As Camera = tr.GetObject(res.ObjectId, OpenMode.ForWrite)
    Dim acCam = cam.AcadObject
    acCam.Location = New Double(2) {1, 3, 4}
    tr.Commit()
End Using

In the above example the camera position will be set to (1,3,4). 

0 Likes