One-key toggle view between ortho and perspective

One-key toggle view between ortho and perspective

pbogucki
Enthusiast Enthusiast
690 Views
2 Replies
Message 1 of 3

One-key toggle view between ortho and perspective

pbogucki
Enthusiast
Enthusiast

Hello, I have been using user-made vba macro to toggle between ortho and perspective view by using single button. It was very helpfull since i could bound it to my spacemouse, but unfortunately i lost that macro somewhere while swaping to new pc setup. Does anyone know similar functionality or maybe is using similar macro and can share it? I were trying to find old macro for days without any results 😕

0 Likes
Accepted solutions (1)
691 Views
2 Replies
Replies (2)
Message 2 of 3

bradeneuropeArthur
Mentor
Mentor
Public Sub perspective()


 Dim oCamera As Inventor.Camera
    Set oCamera = ThisApplication.ActiveView.Camera
    oCamera.perspective = True
    oCamera.ApplyWithoutTransition

End Sub
Public Sub ortho()


 Dim oCamera As Inventor.Camera
    Set oCamera = ThisApplication.ActiveView.Camera
    oCamera.perspective = False
    oCamera.ApplyWithoutTransition

End Sub

Regards,

Arthur Knoors

Autodesk Affiliations & Links:
blue LinkedIn LogoSquare Youtube Logo Isolated on White Background


Autodesk Software:Inventor Professional 2025 | Vault Professional 2024 | Autocad Mechanical 2024
Programming Skills:Vba | Vb.net (Add ins Vault / Inventor, Applications) | I-logic
Programming Examples:
Drawing List!|
Toggle Drawing Sheet!|
Workplane Resize!|
Drawing View Locker!|
Multi Sheet to Mono Sheet!|
Drawing Weld Symbols!|
Drawing View Label Align!|
Open From Balloon!|
Model State Lock!
Posts and Ideas:
My Ideas|
Dimension Component!|
Partlist Export!|
Derive I-properties!|
Vault Prompts Via API!|
Vault Handbook/Manual!|
Drawing Toggle Sheets!|
Vault Defer Update!

! For administrative reasons, please mark a "Solution as solved" when the issue is solved !


 


EESignature

Message 3 of 3

pbogucki
Enthusiast
Enthusiast
Accepted solution

Thank You very much!

I modified it a bit so it is single macro toggle:

Public Sub perspective()


 Dim oCamera As Inventor.Camera
    Set oCamera = ThisApplication.ActiveView.Camera
    If oCamera.perspective = False Then
    oCamera.perspective = True
    Else: oCamera.perspective = True
    oCamera.perspective = False
    End If
    oCamera.ApplyWithoutTransition

End Sub