Reorder DesignViewRepresentations

Reorder DesignViewRepresentations

PetterMoldestad
Enthusiast Enthusiast
528 Views
2 Replies
Message 1 of 3

Reorder DesignViewRepresentations

PetterMoldestad
Enthusiast
Enthusiast

I want to reorder in my design views (DesignViewRepresentations). I've written the code below. It doesn't fail, but nothing seems to happen. Am I missing something or can it be done otherwise?

 

Private Sub btnTest3_Click(sender As Object, e As EventArgs) Handles btnTest3.Click

       Dim oInvApp As Inventor.Application

       Dim oInvAssDoc As Inventor.AssemblyDocument

 

       Try

           oInvApp = GetObject(, "Inventor.Application")

       Catch ex As Exception

           MessageBox.Show("No Inventor open.")

           Return

       End Try

 

       'Set a reference to active Invetor document.

       Try

           oInvAssDoc = oInvApp.ActiveDocument

       Catch ex As Exception

           MessageBox.Show("No Inventor assembly document open.")

           Return

       End Try

 

       Dim oAssCd As AssemblyComponentDefinition

       oAssCd = oInvAssDoc.ComponentDefinition

 

       Dim oPane As BrowserPane

       ' oPane = oDoc.BrowserPanes.Item("AmBrowserArrangement")

       oPane = oInvAssDoc.BrowserPanes.Item("AmBrowserArrangement:Representations")

 

       Dim oInvDvr As DesignViewRepresentation

 

       Dim oInvBrNdPo1 As Inventor.BrowserNode = Nothing

       Dim oInvBrNdPo2 As Inventor.BrowserNode = Nothing

 

       For Each oInvDvr In oAssCd.RepresentationsManager.DesignViewRepresentations

           Dim sViewName As String

           sViewName = oInvDvr.Name

 

           If strFunc.InStr(sViewName, "Pos.Nr. 1") > 0 Then

               oInvBrNdPo1 = oPane.GetBrowserNodeFromObject(oInvDvr)

           ElseIf strFunc.InStr(sViewName, "Pos.Nr. 2") > 0 Then

               oInvBrNdPo2 = oPane.GetBrowserNodeFromObject(oInvDvr)

           End If

       Next

 

       'oPane.Reorder(oInvBrNdPo1, True, oInvBrNdPo2)

       oPane.Reorder(oInvBrNdPo2, True, oInvBrNdPo1)

       oPane.Refresh()

 

       MessageBox.Show("OK")

   End Sub

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

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@PetterMoldestad,

 

Using Inventor API, Design View Representations are unable to reorder. So, a change request is created with engineering team to investigate and details are given below.

 

INVGEN - 22427 - Unable to reorder Design View Representations via Inventor API

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 3

PetterMoldestad
Enthusiast
Enthusiast

Hello Chandra.

I see. Thank you for the information.

0 Likes