User Tools

Site Tools


testplaninv:33:automation

Automation

In interaction with a PDM system, it can be helpful that the export is carried out automatically, e.g. when a document is released.

The Reitec.Testplan for Inventor AddIn provides a simple interface for this purpose.

AddIn Guid = “92C66D5F-1731-4B47-8FAA-A651DF4498CD”

Function: Export

Function Export(FileName As String, TestplanTypeName As String, CreatePDFOutput As Boolean, CreatePDFSource As Boolean, ExportAuthorData As Boolean, CalculateCommonTolerances As Boolean, CommonToleranceClass As String, ByRef HasBubbles As Boolean)

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.
HasBubbles Returns whether the drawing contains stamp symbols.
Return value Indicates whether the export was successful.

Function: ExportExcel

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)

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.

 Public Function RefreshData(TestplanTypeName As String) As Boolean

Function parameter:

Name Description
TestplanTypeName Name of the test plan definition to be exported.

Example macro with call of the interface

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
testplaninv/33/automation.txt · Last modified: 2022/06/24 14:07 by admin