CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetTransmittalReport Method (ActiveX/ATO)

2023-1-1 22:32| 发布者: admin| 查看: 196| 评论: 0|来自: AutoCAD

摘要: 返回包含将作为传递包的一部分包含的报表的文本字符串。

返回包含将作为传递包的一部分包含的报表的文本字符串。

支持的平台:仅窗口

Namespace:传输利布

组装:acETransmit20.tlb

签名

VB.NET:

RetVal = object.getTransmittalReport()

C#:

RetVal = object.getTransmittalReport();
对象

类型:传递操作对象

此方法适用的对象。

返回值(RetVal)

类型:字符串

表示传递报告的文本内容的文本字符串。

言论

没有额外的评论。

发布信息

释放:AutoCAD 2005 及更高版本

历史

  • 该界面与 AutoCAD 2010 版本的库中的界面合并。ITransmittalOperation2ITransmittalOperation
  • 该方法是在 AutoCAD 2005 版本的库中随界面一起引入的。getTransmittalReportITransmittalOperation2

例子

VB.NET:

' Custom command that creates a transmittal package and adds a transmittal report
<CommandMethod("eTransmitCustomReport")> _
Public Shared Sub eTransmitCustomReport()

    ' Create a transmittal operation
    Dim tro As TransmittalOperation = New TransmittalOperation()

    ' Setup the transmittal behavior
    Dim ti As TransmittalInfo = _
        TransInfo(tro.getTransmittalInfoInterface(), "C:\Users\Public\TransmittalAPITest\")

    ' Add a file notification handler
    Dim fileHandler As New MyTransFileNotifier
    tro.subscribeToAddFileNotification(fileHandler)

    ' Setup the progress meter to monitor the files being added to the
    ' transmittal set from the sheet set
    Dim pmHandler As New MyProgressHandler
    tro.setProgressMeter(pmHandler, 1)

    ' Add a sheet set
    TransAddFile(tro, "C:\AutoCAD\Sample\Sheet Sets\Architectural\IRD Addition.dst", FileType.SheetSet)

    ' Append text to the transmittal report
    Dim nFirstSection As Integer = -1
    nFirstSection = tro.addToReport("Custom First Section:", nFirstSection)
    tro.addToReport(Environment.NewLine & "First line of first custom section.", nFirstSection)

    ' Append text to the transmittal report
    Dim nSecondSection As Integer = -1
    nSecondSection = tro.addToReport(Environment.NewLine & "Custom Second Section:", nSecondSection)
    tro.addToReport(Environment.NewLine & "First line of second custom section.", nSecondSection)

    ' Append text to the first section
    tro.addToReport(Environment.NewLine & "Second line of first custom section.", nFirstSection)

    ' Get the transmittal report
    Dim tr As String = tro.getTransmittalReport()

    ' Write the transmittal report to the file "transmittal report.txt" in the
    ' destination root of the transmittal package
    writeReport(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + _
                "\transmittal report.txt", tro.getTransmittalReport())

    ' Add the report to the transmittal package
    Dim tf As TransmittalFile = TransAddFile(tro, _
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + _
                "\transmittal report.txt", FileType.Unknown, Nothing)

    ' Change the path of the transmittal report
    tf.targetSubPath = ""

    ' Remove the file notification handler
    tro.cancelSubscriptionToAddFileNotification(fileHandler)

    ' Create the transmittal package
    ' Files are copied and resaved to the path specified by the destinationRoot property
    ' and the other settings of the TransmittalInfo object.
    tro.createTransmittalPackage()
End Sub

C#:

// Custom command that creates a transmittal package and adds a transmittal report
[CommandMethod("eTransmitCustomReport")]
public static void eTransmitCustomReport()
{
    // Create a transmittal operation
    TransmittalOperation tro = new TransmittalOperation();

    // Setup the transmittal behavior
    TransmittalInfo ti = TransInfo(tro.getTransmittalInfoInterface(),
                                   "C:\\Users\\Public\\TransmittalAPITest\\");

    // Add a file notification handler
    MyTransFileNotifier fileHandler = new MyTransFileNotifier();
    tro.subscribeToAddFileNotification(fileHandler);

    // Setup the progress meter to monitor the files being added to the
    // transmittal set from the sheet set
    MyProgressHandler pmHandler = new MyProgressHandler();
    tro.setProgressMeter(pmHandler, 1);

    // Add a sheet set
    TransAddFile(tro, "C:\\AutoCAD\\Sample\\Sheet Sets\\Architectural\\IRD Addition.dst",
                 FileType.SheetSet);

    // Append text to the transmittal report
    int nFirstSection = -1;
    nFirstSection = tro.addToReport("Custom First Section:", nFirstSection);
    tro.addToReport(Environment.NewLine + "First line of first custom section.", nFirstSection);

    // Append text to the transmittal report
    int nSecondSection = -1;
    nSecondSection = tro.addToReport(Environment.NewLine + "Custom Second Section:", nSecondSection);
    tro.addToReport(Environment.NewLine + "First line of second custom section.", nSecondSection);

    // Append text to the first section
    tro.addToReport(Environment.NewLine + "Second line of first custom section.", nFirstSection);

    // Get the transmittal report
    string tr = tro.getTransmittalReport();

    // Write the transmittal report to the file "transmittal report.txt" in the
    // destination root of the transmittal package
    writeReport(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
                "\\transmittal report.txt", tro.getTransmittalReport());

    // Add the report to the transmittal package
    TransmittalFile tf = TransAddFile(tro,
                Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) +
                "\\transmittal report.txt", FileType.Unknown, null);

    // Change the path of the transmittal report
    tf.targetSubPath = "";

    // Remove the file notification handler
    tro.cancelSubscriptionToAddFileNotification(fileHandler);

    // Create the transmittal package
    // Files are copied and resaved to the path specified by the destinationRoot property
    // and the other settings of the TransmittalInfo object.
    tro.createTransmittalPackage();
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

QQ|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 )

GMT+8, 2024-5-11 19:10

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部