ActiveX Viewpoint Folder Structure

bbrown
Advocate
Advocate

ActiveX Viewpoint Folder Structure

bbrown
Advocate
Advocate

I have been able to extract with VBScript all the viewpoints from a NWD model like the example shows, but I'm wondering if the folder structure can be referenced the same way. I would like to group my saved viewpoints by folder on the webpage.

0 Likes
Reply
Accepted solutions (1)
831 Views
4 Replies
Replies (4)

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

Do you want to access the folder and the view points within it? If yes, following is some small code.

 

Private Sub recurseFolderView(view As InwOpFolderView)

   Dim eachView As InwOpSavedView
   Dim oFolderView As InwOpFolderView
  
   For Each eachView In view.SavedViews
  
      If eachView.Type = eSavedViewType_Folder Then
         Debug.Print eachView.Name & "is a folder"
         Set oFolderView = eachView
         recurseFolderView oFolderView
      Else
          MsgBox "next view  " & eachView.Name
         m_state.ApplyView eachView
      End If
  
   Next
End Sub

Private Sub ApplyViewWithEachSavedView()

Dim savedview As InwOpSavedView
Dim oFolderView As InwOpFolderView

For Each savedview In m_state.SavedViews
 
  If savedview.Type = eSavedViewType_Folder Then
      
     Set oFolderView = savedview
    
     recurseFolderView oFolderView
     
  Else   
    
       MsgBox "next view  " & savedview.Name
    
      m_state.ApplyView savedview
  End If
 
Next

Regards,

Xiaodong Liang

Developer Technical Services

0 Likes

bbrown
Advocate
Advocate

I am using VBScript and the redistributable API inside a webpage for this project and I'm having difficulty referencing the nested views to change them programmatically. The InwOPSavedView.nwID property gives me a permission denied error, so I am unsure how to find a particular view once I've wrote a list to my website. The only way I can think to find the view again is to loop back over the views and match them by name, which will be problematic if there are two with the same name. Is there another way I'm not seeing?

0 Likes

bbrown
Advocate
Advocate

In an stateless environment like a browser, how am I supposed to find a SavedView again using the Unlicensed API? (Redistributable ActiveX control)

0 Likes

bbrown
Advocate
Advocate

Figured this one out. I had to build an array in VBScript of all the view objects and reference that array when my button was clicked.

0 Likes