By Adam Nagy
If you want to create a saved view using VBScript then the following code should help:
'create new document
set navis_doc = CreateObject("NavisWorks.Document")
'make sure it's visible
navis_doc.visible = true
'open document
navis_doc.OpenFile("C:\examples\gatehouse.nwd")
'get state object
set navis_state = navis_doc.state()
'create saved view from current view
' since VBScript does not support enum's therefore either use the
' enum value (11 = eObjectType_nwOpView) directly or use
' GetEnum() to get it
enumVal = navis_state.GetEnum("eObjectType_nwOpView")
set navis_view = navis_state.ObjectFactory(enumVal)
navis_view.name = "MySavedView"
navis_view.anonview = navis_state.CurrentView
navis_state.SavedViews().Add(navis_view)
'make sure app stays open with no refs
navis_doc.stayopen