Studio sessions checker framework

 (C)2021 Ron E. Allen - all rights reserved.

This dumps the raw XML sessions file – we could get a little fancier and read the XML pieces individually or strip away the unneeded info form the XML file:

 ----------------------------------------------------------------------

ron.allen 

xx-systemID--

----------------------------------------------------------------------

123-456-789 Last Modified: 2021-01-01t0001

<?xml version="1.0" encoding="utf-8"?>

<Session Version="1.0">

  <Document>Somefile   20xx.xx.xx_xx.pdf?</Document>

  <Active>Somefile   20xx.xx.xx_xx.pdf?</Active>

</Session>

----------------------------------------------------------------------

123-456-788 Last Modified: 2021-01-01t0002

<?xml version="1.0" encoding="utf-8"?>

<Session Version="1.0" />

----------------------------------------------------------------------

 

----------------------------------------------------------------------

 

 (Excel back end VBA module prototype)

Attribute VB_Name = "BlueBeamSessions"

Const strBrk = vbCr & "----------------------------------------------------------------------" & vbCr Dim msg As String ''String message Sub Main() ''check for Bluebeam sessions Dim FSO As New FileSystemObject ''File system access Dim ofold As Folder ''primary folder Dim osFold As Folder ''sub folders Dim SH As WshShell ''Windows shell Dim strFP As String ''File path for studio Dim ofileTxt As TextStream ''Text stream Set SH = CreateObject("WScript.Shell") ''set shell object AppData = SH.SpecialFolders("AppData") ''%localappdata% ''%localappdata%\Revu\data\Sessions\studio.bluebeam.com\???-???-???\SessionInfo.xml strFP = AppData & "\..\local\\Revu\data\Sessions\studio.bluebeam.com\" Set FSO = CreateObject("Scripting.FileSystemObject") msg = strBrk ''Clean msg msgadd CreateObject("WScript.Network").UserName & vbCr msgadd CreateObject("WScript.Network").ComputerName msgadd strBrk If Not FSO.FolderExists(strFP) Then ''Folder doesn't exist msgadd "Folder doesn't exist- No studio porjects present." Else ''Folder exists Set ofold = FSO.GetFolder(strFP) For Each osFold In ofold.SubFolders msgadd osFold.Name Set ofileTxt = Nothing If Not FSO.FileExists(osFold.Path & "\SessionInfo.xml") Then msgadd "No Session file exists." & vbCr & strBrk Else Set ofileTxt = FSO.OpenTextFile(osFold.Path & "\SessionInfo.xml") msgadd " Last Modified: " & Format(FSO.GetFile(osFold.Path & "\SessionInfo.xml").DateLastModified, "yyyy-mm-dd\tHHmm") & vbCr msgadd ofileTxt.ReadAll & strBrk ofileTxt.Close End If Next osFold End If msgadd strBrk Debug.Print msg End Sub Sub msgadd(ByRef msgadd) msg = msg & msgadd End Sub

 

Comments

Popular posts from this blog

Revit area plans adding new types and references (Gross and rentable)

Powerpoint countdown and current time in slides VBA

Revit Python in Visual Studio Revit Stubs 2022 for Python Revit Intellisense