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?
Solved! Go to Solution.
Solved by JohanLarsson. Go to Solution.
Does the VBA code raise error? It works fine here.
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.
OK, tried it in IV 2012 now, it works as expected.
I don't have 2012.
Does it work because the ability to change view orientation is a new feature of 2012?
Mike