Report main screen
CAD Time Tracking
Client: BSB Design (United States)
Date: December 2015
Technlogie: AutoCAD, VB .Net, SQLite, Excel
This application can calculate the actual time that users spend on achieving their drawing. The data is stored in a local database SQLite and the results of all users can be combined in a network database of the same type . Reports are extracted according to the period , the designer and drawing. These reports can also be exported to an Excel workbook.
Code sample
The first function catches all changes to the drawing and the second function process the time spent in the drawing. The second function uses a custom object class ( TimeTrackingData ) that contains the properties and methods required for information processing.
Private Sub docObjectModified(ByVal senderObj As Object, _
ByVal ObjectModifiedEvtArgs As ObjectEventArgs)
ProcessTimeTracking()
End Sub
Private Sub ProcessTimeTracking()
Dim ed As Editor = Application.DocumentManager.MdiActiveDocument.Editor
If m_TimeTrackingData Is Nothing Then
m_TimeTrackingData = SetTimeTrackingData()
m_dtLastSavedTime = m_TimeTrackingData.EndTime
m_TimeTrackingData.Save(m_TimeTrackingInfo.LocalDBName)
Else
If Now - m_TimeTrackingData.EndTime > m_TimeTrackingInfo.IdleTime Then
m_TimeTrackingData = SetTimeTrackingData()
m_dtLastSavedTime = m_TimeTrackingData.EndTime
m_TimeTrackingData.Save(m_TimeTrackingInfo.LocalDBName)
Else
m_TimeTrackingData.DrawingName = GetActiveDrawingFullName()
m_TimeTrackingData.EndTime = Now
If m_TimeTrackingData.EndTime - m_dtLastSavedTime > m_TimeTrackingInfo.IdleTime Then
m_TimeTrackingData.Save(m_TimeTrackingInfo.LocalDBName)
m_dtLastSavedTime = m_TimeTrackingData.EndTime()
End If
End If
End If
End Sub