User Tools

Site Tools


testplaninv:33:automation

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
testplaninv:33:automation [2022/04/07 15:34]
admin created
testplaninv:33:automation [2022/06/24 14:07] (current)
admin [Function: ExportExcel]
Line 25: Line 25:
 |Return value | Indicates whether the export was successful. | |Return value | Indicates whether the export was successful. |
  
 +===== Function: ExportExcel =====
  
 +<code vb>
 +Function ExportExcel(FileName As String, TestplanTypeName As String, CreatePDFOutput As Boolean, CreatePDFSource As Boolean, ExportAuthorData As Boolean, CalculateCommonTolerances As Boolean, CommonToleranceClass As String, ExcelTemplateFileName As String, HideWorksheet As Boolean, ByRef HasBubbles As Boolean)
 +</code>
 +
 +**Function parameter:**
 +^Name ^Description^
 +|FileName | Full file name of the file in which the data is to be saved. |
 +|TestplanTypeName | Name of the test plan definition to be exported. |
 +|CreatePDFOutput | Indicates whether a PDF is to be saved in the output path. |
 +|CreatePDFOutput | Specifies whether a PDF is to be saved in the folder of the drawing.|
 +|ExportAuthorData | Specifies whether to export Reitec.Testplan.Author data. |
 +|CalculateCommonTolerances | Specifies whether common tolerances are to be calculated. If so, the parameter 'CommonToleranceClass' must be specified. |
 +|CommonToleranceClass | Name of the general tolerance to be used for calculating the general tolerances. |
 +|ExcelTemplateFileName| Full file name of the Excel template to be used in the export. |
 +|HideWorksheet | Specify whether to hide the worksheet containing the test plan data. |
 +|HasBubbles | Returns whether the drawing contains stamp symbols. |
 +|Return value | Indicates whether the export was successful. |
 +
 +===== Function: Refresh =====
 +Updates the characteristic data of an inspection plan.
 +
 +<code vb>
 + Public Function RefreshData(TestplanTypeName As String) As Boolean
 +</code>
 +
 +
 +**Function parameter:**
 +^Name ^Description^
 +|TestplanTypeName | Name of the test plan definition to be exported.|
 +===== Example macro with call of the interface =====
 +
 +<code vb>
 +Sub TestplanExportTest()
 +    Dim xlsxOutputFile As String
 +    Dim dfdOutputFile As String
 +    Dim hasBubbles As Boolean
 +    Dim testplanType As String
 +    Dim createPDF As Boolean
 +    Dim exportAuthorData As Boolean
 +    Dim calculateCommonTolerances As Boolean
 +    Dim commonToleranceClass As String
 +    Dim hideExcelWorksheet As Boolean
 +    Dim excelTemplateFilename As String
 +    
 +    
 +    'adjust file paths accordingly
 +    xlsxOutputFile = "C:\temp\Test.xlsx"
 +    dfdOutputFile = "C:\temp\Test.dfd"
 +    testplanType = "Full-Dimension_1"
 +    createPDF = False
 +    exportAuthorData = False
 +    calculateCommonTolerances = True
 +    commonToleranceClass = "ISO 2768f"
 +    hideExcelWorksheet = True
 +    excelTemplateFilename = "C:\temp\Testplan_Template.xlsx"
 +
 +    'get AddIn
 +    Dim addins As Object
 +    Dim addin As Object
 +    Dim addinObject As Object
 +    Dim result As String
 +  
 +    Set addins = ThisApplication.ApplicationAddIns
 +    Set addin = addins.ItemById("{92C66D5F-1731-4B47-8FAA-A651DF4498CD}")
 +
 +    Set addinObject = addin.Automation
 +    'XLSX export
 +    result = addinObject.ExportExcel(xlsxOutputFile, testplanType, createPDF, createPDF, exportAuthorData, calculateCommonTolerances, commonToleranceClass, excelTemplateFilename, hideExcelWorksheet, hasBubbles)
 +    
 +    If result = True And hasBubbles = True Then
 +        'DFD export
 +        result = addinObject.Export(dfdOutputFile, testplanType, createPDF, createPDF, exportAuthorData, calculateCommonTolerances, commonToleranceClass, hasBubbles)
 +    End If
 +End Sub
 +</code>
testplaninv/33/automation.1649338459.txt.gz ยท Last modified: 2022/04/07 15:34 by admin