GetNumberOfFiles Method (ActiveX/ATO)

Returns the number of files in the files graph of the transmittal set.

Supported platforms: Windows only

Namespace: TRANSMITTALLib

Assembly: AcETransmit19.tlb

Signature

VB.NET:

RetVal = object.getNumberOfFiles(bIncludeMissingFiles, bIncludeUnselectedFiles)

C#:

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

Type: TransmittalFilesGraph object

The object this method applies to.

bIncludeMissingFiles

Access: Input-only

Type: Long

  • 0 (False): Referenced files that are missing are not included in the count.
  • 1 (True): Referenced files that are missing are included in the count.
bIncludeUnselectedFiles

Access: Input-only

Type: Long

  • 0 (False): Unselected files in the visual files graph are not included in the count.
  • 1 (True): Unselected files in the visual files graph are included in the count.

Return Value (RetVal)

Type: Long

Total number of files that are in the files graph of the transmittal set based on the filter criteria.

Remarks

No additional remarks.

Release Information

Releases: AutoCAD 2004 and later

Examples

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;
}