Message 1 of 2
Close sheet set - or force a refresh?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
TL:DR how do I close a sheet set?
The following code does nothing (no crashes, just smiles and nods..)
Public Function RefreshSheetSet(SSfilename As String) As String
On Error GoTo ErrorRefresh
Dim OSSM As New AcSmSheetSetMgr
Dim DbIter As IAcSmEnumDatabase
Dim DB As AcSmDatabase
Dim CurSSet As AcSmSheetSet
Dim Retval
Dim SSFile As String
'refreshes current sheet set
Set DbIter = OSSM.GetDatabaseEnumerator
If DbIter Is Nothing Then
'ssm not loaded
RefreshSheetSet = "Sheetset manager not loaded"
Exit Function
End If
DbIter.Reset
Set DB = DbIter.Next
If DB Is Nothing Then
Refreshseetset = "No Sheetset loaded"
Exit Function
Else
Do While Not DB Is Nothing
SSFile = DB.GetFileName
If SSFile = SSfilename Then
Set CurSSet = DB.GetSheetSet
OSSM.Close DB
'Set DB = OSSM.OpenDatabase(SSFile)
RefreshSheetSet = "Sheetset re-loaded"
Exit Do
End If
Set DB = DbIter.Next
Loop
End If
Exit Function
ErrorRefresh:
DB.UnlockDb DB
RefreshSheetSet = Err.Description
End Function
Background:
Due to circumstances beyond my control our drawing filesystem is hosted on the cloud, with filesystem access provided by cloud drive mapper by IAM
Everything works, albeit slowly, but adequately, apart from a custom vba script to insert a sheet into the current sheet set - the sheet set manager doesn't reflect the change until it's closed and re-opened. In the absence of any better ideas, I thought I'd just get the script to close and then re-open the sheet set. Easier said than done.
Any suggestions on closing the sheet set?
ACad, MEP, Revit, 3DS Max