Assembly current view

Assembly current view

Anonymous
Not applicable
930 Views
9 Replies
Message 1 of 10

Assembly current view

Anonymous
Not applicable

Hi,

Is it possible to know if the assembly view is isometric view or not.I need to perform check to get this value.

 

Thanks

Sheena

0 Likes
Accepted solutions (1)
931 Views
9 Replies
Replies (9)
Message 2 of 10

ekinsb
Alumni
Alumni

Are you talking about a view of an assembly in an drawing or the current view of an assembly when working on the assembly?

 

 

 


Brian Ekins
Inventor and Fusion 360 API Expert
Mod the Machine blog
0 Likes
Message 3 of 10

Anonymous
Not applicable
No im talking about the current view of an assembly when working on the assembly.I want to check if the assembly view is Isometric view when i open a saved assembly.
0 Likes
Message 4 of 10

jdkriek
Advisor
Advisor

There are a few ways to check the camera position and view, but it won't always be the same as hitting F6.

 

So personally I just automatically set it to F6 on Save.

 

Dim oCommandMgr As CommandManager
Set oCommandMgr = ThisApplication.CommandManager
Call oCommandMgr.ControlDefinitions.Item("AppIsometricViewCmd").Execute2(True)

 

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes
Message 5 of 10

Anonymous
Not applicable
Im actually supposed to perform a check wherein it checks for the assembly whether it is isometric view or not.Im not supposed to set it if it is not in isometric view i need to pop an error.Is it possible by any chance.Thanks a lot for replying.
0 Likes
Message 6 of 10

Anonymous
Not applicable
Accepted solution

Hello,

 

If I got you question right, then my solution is as follows.

 

In Inventor when you get a part or assembly it will be in 3Dimensional view. Not like in AuotCAD or Architecture where we can set to SW ISometric or SE Isometric etc.

 

In Autodesk Inventor, you will have only two options Orthographic or Perspective.

 

I have devoloped a code which will get view orientation of the assembly opened in Autidesk Inventor window.

The view orientation will be displayed in a msg box.

 

Use the following code.

Option Explicit

Sub Viewtest()

Dim oDoc As Document
Set oDoc = ThisApplication.ActiveDocument
Dim oview As View
Set oview = oDoc.Views.item(1)

' To get view is perspective or not.
' If view is not perspective then it is Orthographic.
MsgBox oview.Camera.Perspective

' gets view orientation in Inventor Window.
Dim orientype As ViewOrientationTypeEnum
 orientype = oview.Camera.ViewOrientationType
If orientype = 10763 Then
    MsgBox "Arbitrary View" & " & Standard Enum Value: " & "kArbitraryViewOrientation"
 Else
If orientype = 10756 Then
    MsgBox "Back View" & " & Standard Enum Value:  " & "kBackViewOrientation"
 Else
If orientype = 10757 Then
    MsgBox "Bottom View" & " & Standard Enum Value: " & "kBottomViewOrientation"
 Else
If orientype = 10765 Then
    MsgBox "Current View" & " & Standard Enum Value: " & "kCurrentViewOrientation"
 Else
If orientype = 10753 Then
    MsgBox "default View" & " & Standard Enum Value: " & "kDefaultViewOrientation"
 Else
If orientype = 10773 Then
    MsgBox "Sheet metal flat pattern backside pivot 180 degrees" & " & Standard Enum Value: " & "kFlatBacksidePivot180ViewOrientation"
 Else
 If orientype = 10772 Then
    MsgBox "Sheet metal flat pattern backside pivot left" & " & Standard Enum Value: " & "kFlatBacksidePivotLeftViewOrientation"
 Else
 If orientype = 10771 Then
    MsgBox "Sheet metal flat pattern backside pivot right" & " & Standard Enum Value: " & "kFlatBacksidePivotRightViewOrientation"
 Else
 If orientype = 10770 Then
    MsgBox "Sheet metal flat pattern backside" & " & Standard Enum Value: " & "kFlatBacksideViewOrientation"
 Else
 If orientype = 10769 Then
    MsgBox "Sheet metal flat pattern pivot 180 degrees" & " & Standard Enum Value: " & "kFlatPivot180ViewOrientation"
 Else
 If orientype = 10768 Then
    MsgBox "Sheet metal flat pattern pivot left" & " & Standard Enum Value: " & "kFlatPivotLeftViewOrientation"
 Else
 If orientype = 10767 Then
    MsgBox "Sheet metal flat pattern pivot right" & " & Standard Enum Value: " & "kFlatPivotRightViewOrientation"
 Else
 If orientype = 10764 Then
    MsgBox "Front View" & " & Standard Enum Value: " & "kFrontViewOrientation"
 Else
 If orientype = 10762 Then
    MsgBox "Isometric -- Bottom Left View" & " & Standard Enum Value: " & "kIsoBottomLeftViewOrientation"
 Else
 If orientype = 10761 Then
    MsgBox "Isometric -- Bottom Right View" & " & Standard Enum Value: " & "kIsoBottomRightViewOrientation"
 Else
 If orientype = 10760 Then
    MsgBox "Isometric -- Top Left View" & " & Standard Enum Value: " & "kIsoTopLeftViewOrientation"
 Else
 If orientype = 10759 Then
    MsgBox "Isometric -- Top Right View" & " & Standard Enum Value: " & "kIsoTopRightViewOrientation"
 Else
 If orientype = 10758 Then
    MsgBox "Left View" & " & Standard Enum Value: " & "kLeftViewOrientation"
 Else
 If orientype = 10755 Then
    MsgBox "Right View" & " & Standard Enum Value: " & "kRightViewOrientation"
 Else
  If orientype = 10766 Then
    MsgBox "Saved camera View" & " & Standard Enum Value: " & "kSavedCameraViewOrientation"
 Else
  If orientype = 10754 Then
    MsgBox "Top View" & " & Standard Enum Value: " & "kTopViewOrientation"
 Else
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If

End Sub

 Cheers

AD.

Message 7 of 10

Anonymous
Not applicable

First msgbox give if perspective view is in perspective mode or not.

 

Second msgbox will give view orientation type.

0 Likes
Message 8 of 10

Anonymous
Not applicable
Thanks a lot for the reply got it 🙂
0 Likes
Message 9 of 10

Anonymous
Not applicable

Glad It worked !!!!!!!!

 

Please press Accept as Solution  so our friends in forums use this and some Kudos !!!!!!! Thumbs Up Smiley Happy :smileyhappy :smileyhappy

 

Cheers

AD

Message 10 of 10

jdkriek
Advisor
Advisor

ADNpati,

 

You can't depend on that method, it's too easy to for a user to redefine the cube without you knowing.

 

Also use a SWITCH statement, will be 3x faster than also those IF statements nestled together.

Jonathan D. Kriek
MFG Solutions Engineer
KETIV Technologies, Inc.


0 Likes