Community
Navisworks API
Welcome to Autodesk’s Navisworks API Forums. Share your knowledge, ask questions, and explore popular Navisworks API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ActiveX Viewpoint Folder Structure

4 REPLIES 4
SOLVED
Reply
Message 1 of 5
bbrown
829 Views, 4 Replies

ActiveX Viewpoint Folder Structure

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.

4 REPLIES 4
Message 2 of 5
xiaodong_liang
in reply to: bbrown

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

Message 3 of 5
bbrown
in reply to: xiaodong_liang

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?

Message 4 of 5
bbrown
in reply to: bbrown

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

Message 5 of 5
bbrown
in reply to: bbrown

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.

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

Post to forums  

Rail Community


 

Autodesk Design & Make Report