Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

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

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
JohanLarsson
666 Views, 4 Replies

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

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?

-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12
4 REPLIES 4
Message 2 of 5
YuhanZhang
in reply to: JohanLarsson

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
JohanLarsson
in reply to: YuhanZhang

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.

-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12
Message 4 of 5
JohanLarsson
in reply to: JohanLarsson

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

-------------------------------------------------------------------------
Inventor Professional 2012 SP1 (25 seats with subscription)
Windows 7 64 bit
Lenovo D20, 12 GB RAM, Intel Xeon X5687 3.6 GHz, SSD
Quadro 4000, driver 8.17.12.9573, dual monitors
SpacePilot, driver version 6.15.3 Firmware 3.12
Message 5 of 5
Mike_Maenpaa
in reply to: JohanLarsson

I don't have 2012.

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

 

Mike

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report