Programmatically extracting data from the data collector
I am building an application in which I am capturing data from an image document grabbing count/size data and stats. I now would like to use the data collector in an effort to collect data from replicate images accessing summary stats as I measure images. I need to know how to programmatically access stat data from the data collector. Also I would like to access all or individual blocks of data from the data collector. Could you forward example code?
0
Best Answer
-
Rod,Yes, you are right GetData command will be available only in 9.1. Meanwhile you have to get that DataSet using direct property, like this:
Public Function GetDCStats() As SimpleScript GetDCStats = New SimpleScript Dim dataSet With Automate.ScriptingCommands.CodeCommand(GetDCStats) If .Run() Then ' User Code Here' 'get Data dataSet=MediaCy.Addins.DataCollector.McDataCollectorAddin.ThisAddin.Document.Data For Each table As System.Data.DataTable In dataSet.tables Debug.Print String.Format("Table - {0}",table.TableName) For Each col As System.Data.DataColumn In table.Columns 'print Mean' Debug.Print String.Format("Mean of {0} = {1}", col.Caption,GetColumnStats(col).Mean) Next Next End If End With End Function
Yuri0
Answers
Pierre
Yuri:
Thank you very much for the example. This is most helpful. However, I am running 9.0.4 and at Load, the Scripting Workbench reports that it cannot find GetData as a member of MediaCy.Automation.Measure.Data.CollectorCommands. I checked the Help file and GetData is not listed there. I am overlooking something obvious I am sure. Can you point me in the correct direction?
Thanks much!
//////Rod
Yuri:
Thanks much. Do you know when 9.1 will be released?
////Rod