CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

GetNumberOfFiles Method (ActiveX/ATO)

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

摘要: 返回传递集的文件图中的文件数。

返回传递集的文件图中的文件数。

支持的平台:仅窗口

Namespace:传输利布

组装:acETransmit20.tlb

签名

VB.NET:

RetVal = object.getNumberOfFiles(bIncludeMissingFiles, bIncludeUnselectedFiles)

C#:

RetVal = object.getNumberOfFiles(bIncludeMissingFiles, bIncludeUnselectedFiles);
对象

类型:传递文件图形对象

此方法适用的对象。

b包括丢失的文件

访问:仅输入

类型:

  • 0 (): 缺少的引用文件不包括在计数中。False
  • 1 (): 缺少的引用文件包含在计数中。True
b包括未选择的文件

访问:仅输入

类型:

  • 0 (): 可视文件图中未选择的文件不包括在计数中。False
  • 1 (): 可视文件图中未选择的文件包含在计数中。True

返回值(RetVal)

类型:

基于筛选条件的传递集的文件图中的文件总数。

言论

没有额外的评论。

发布信息

释放:AutoCAD 2004 及更高版本

历史

  • 该界面与 AutoCAD 2010 版本的库中的界面合并。ITransmittalFilesGraph2ITransmittalFilesGraph
  • 该方法也随界面一起引入 AutoCAD 2005 版本的库。getNumberOfFilesITransmittalFilesGraph2
  • 该方法最初是在 AutoCAD 2004 版本的库中随界面一起引入的,但标记为仅供 Autodesk 内部使用。getNumberOfFilesITransmittalFilesGraph

例子

VB.NET:

' Custom command to work with the transmittal file graph
<CommandMethod("FilesGraph")> _
Public Shared Sub FilesGraph()

    ' 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\")

    ' Get the root file of the transmittal file graph
    Dim tfRoot As TransmittalFile = tro.getTransmittalGraphInterface().getRoot()

    ' Add a drawing file to a transmittal set
    Dim tfFirst As TransmittalFile = Nothing
    tro.addDrawingFile("C:\AutoCAD\Sample\Sheet Sets\Architectural\A-01.dwg", tfFirst)

    ' Add a second drawing file to a transmittal set
    Dim tfSecond As TransmittalFile = Nothing
    tro.addDrawingFile("C:\AutoCAD\Sample\Sheet Sets\Architectural\A-02.dwg", tfSecond)

    ' Display the name and path of the first file of the transmittal file graph
    MsgBox("File name and path: " & tro.getTransmittalGraphInterface().getAt(0).sourcePath)

    ' Display the number of files in the transmittal file graph
    MsgBox("Number of Files in Graph: " & tro.getTransmittalGraphInterface().getNumberOfFiles(vbTrue, vbTrue).ToString())

    ' Display the number of dependees
    MsgBox("Number of Dependees: " & tfFirst.numberOfDependees.ToString())

    ' Create a reference from the first file to the newly added file
    tro.getTransmittalGraphInterface().addEdge(tfSecond, tfFirst)

    ' Display the number of dependees
    MsgBox("Number of Dependees: " & tfFirst.numberOfDependees.ToString())

    ' Remove a reference from the first file
    tro.getTransmittalGraphInterface().removeEdge(tfSecond, tfFirst)
    ' Display the number of dependees
    MsgBox("Number of Dependees: " & tfFirst.numberOfDependees.ToString())

    ' Resets the transmittal graph
    tro.getTransmittalGraphInterface().reset()

    ' Display the number of files in the transmittal file graph
    MsgBox("Number of Files in Graph: " & tro.getTransmittalGraphInterface().getNumberOfFiles(vbTrue, vbTrue).ToString())

    ' Release the tramnsmittal operation
    tro = Nothing
End Sub

C#:

// Custom command to work with the transmittal file graph
[CommandMethod("FilesGraph")]
public static void FilesGraph()
{
    // Create a transmittal operation
    TransmittalOperation tro = new TransmittalOperation();

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

    // Get the root file of the transmittal file graph
    TransmittalFile tfRoot = tro.getTransmittalGraphInterface().getRoot();

    // Add a drawing file to a transmittal set
    TransmittalFile tfFirst = null;
    tro.addDrawingFile(@"C:\AutoCAD\Sample\Sheet Sets\Architectural\A-01.dwg", out tfFirst);

    // Add a second drawing file to a transmittal set
    TransmittalFile tfSecond = null;
    tro.addDrawingFile(@"C:\AutoCAD\Sample\Sheet Sets\Architectural\A-02.dwg", out tfSecond);

    // Display the name and path of the first file of the transmittal file graph
    System.Windows.MessageBox.Show("File name and path: " + tro.getTransmittalGraphInterface().getAt(0).sourcePath);

    // Display the number of files in the transmittal file graph
    System.Windows.MessageBox.Show("Number of Files in Graph: " + tro.getTransmittalGraphInterface().getNumberOfFiles(1, 1).ToString());

    // Display the number of dependees
    System.Windows.MessageBox.Show("Number of Dependees: " + tfFirst.numberOfDependees.ToString());

    // Create a reference from the root file to the newly added file
    tro.getTransmittalGraphInterface().addEdge(tfSecond, tfFirst);

    // Display the number of dependees
    System.Windows.MessageBox.Show("Number of Dependees: " + tfFirst.numberOfDependees.ToString());

    // Remove a reference from the root file
    tro.getTransmittalGraphInterface().removeEdge(tfSecond, tfFirst);

    // Display the number of dependees
    System.Windows.MessageBox.Show("Number of Dependees: " + tfFirst.numberOfDependees.ToString());

    // Resets the transmittal graph
    tro.getTransmittalGraphInterface().reset();

    // Display the number of files in the transmittal file graph
    System.Windows.MessageBox.Show("Number of Files in Graph: " + tro.getTransmittalGraphInterface().getNumberOfFiles(1, 1).ToString());

    // Release the tramnsmittal operation
    tro = null;
}

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-12 07:04

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部