Is it possible to change the camera for a drawing view?

Is it possible to change the camera for a drawing view?

Anonymous
Not applicable
866 Views
4 Replies
Message 1 of 5

Is it possible to change the camera for a drawing view?

Anonymous
Not applicable

Hello,

We are sometimes faced with the problem that we would like change the coordinate system of the model and have the drawing update it with the new orientation of the part without the need to place every annotation again. This is mostly for legacy parts and assemblies which are not modeled correct according to the coordinate system of the machine.

 

The following sample code does not work, is this by design or is there an error in the code?

 

Public Sub RotateFirstView()
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument
    Dim oDrawView As DrawingView
    Set oDrawView = oDrawDoc.Sheets(1).DrawingViews(1)
    Dim oCamera As Camera
    Set oCamera = oDrawView.Camera
    Debug.Print oCamera.ViewOrientationType = kFrontViewOrientation
    oCamera.ViewOrientationType = kIsoBottomLeftViewOrientation
    oCamera.Apply
End Sub

 

 Is there any other way to do this?

0 Likes
Accepted solutions (1)
867 Views
4 Replies
Replies (4)
Message 2 of 5

YuhanZhang
Autodesk
Autodesk

Does the VBA code raise error? It works fine here.



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

Message 3 of 5

Anonymous
Not applicable

I get Run-time error '445': Object doesn't support this action on the line:

 

oCamera.ViewOrientationType = kIsoBottomLeftViewOrientation

 

I am still using Inventor 2010, maybe this is the issue? I can try to run it on Inventor 2011 later today.

0 Likes
Message 4 of 5

Anonymous
Not applicable
Accepted solution

OK, tried it in IV 2012 now, it works as expected.

0 Likes
Message 5 of 5

Anonymous
Not applicable

I don't have 2012.

Does it work because the ability to change view orientation is a new feature of 2012?

 

Mike

0 Likes