AddSheetSelset 方法 (ActiveX/ATO) 
将图纸集选区中的图形文件添加到传递集。 支持的平台:仅限 Windows 命名空间:传输塔利布 程序集: acETransmit20.tlb 签名VB.NET: object.addSheetSelset pISheetSelset, includeSSFiles C#: object.addSheetSelset(pISheetSelset, includeSSFiles); 
 返回值 (RetVal)无返回值。 言论没有其他评论。 发行信息释放:AutoCAD 2005 及更高版本 历史
 例子VB.NET: ' Custom command to create a transmittal package from a sheet selection set in a sheet set
<CommandMethod("eTransmitDSTFile_SheetSelSet")> _
Public Shared Sub eTransmitDSTFile_SheetSelSet()
    ' 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 sheet selection set from a sheet set 
    ' and the drawings contained in it
    ' Get a reference to the Sheet Set Manager object
    Dim sheetSetManager As IAcSmSheetSetMgr = New AcSmSheetSetMgr
    ' Open a Sheet Set file
    Dim sheetSetDatabase As AcSmDatabase = _
        sheetSetManager.OpenDatabase("C:\AutoCAD\Sample\Sheet Sets\Architectural\IRD Addition.dst", False)
    ' Get all the SheetSelSets in the sheet set
    Dim sheetSelSetEnum As IAcSmEnumSheetSelSet = _
        sheetSetDatabase.GetSheetSet().GetSheetSelSets().GetEnumerator()
    ' Get the first SheetSelSet
    Dim sheetSelSet As AcSmSheetSelSet = sheetSelSetEnum.Next()
    Dim sheetSelSetFound As AcSmSheetSelSet = Nothing
    ' Check to the see if it is the requested SheetSelSet, 
    ' if not get the next and check
    While Not sheetSelSet Is Nothing
        If UCase(sheetSelSet.GetName()). _
                        Equals("ELEVATIONS") = True Then
            sheetSelSetFound = sheetSelSet
        End If
        sheetSelSet = sheetSelSetEnum.Next()
    End While
    ' Get the sheet set from the database and process it
    ' 0 - Do not include DST file or support files referenced 
    '     by the DST file (templates, blocks, ...)
    ' 1 - Include DST file, all files referenced by the 
    '     DST file, its sheets and references
    If Not sheetSelSetFound Is Nothing Then
        tro.addSheetSelset(sheetSelSetFound, 0)
    End If
    ' Close the sheet set
    sheetSetManager.Close(sheetSetDatabase)
    ' 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 to create a transmittal package from a sheet selection set in a sheet set
[CommandMethod("eTransmitDSTFile_SheetSelSet")]
public static void eTransmitDSTFile_SheetSelSet()
{
    // Create a transmittal operation
    TransmittalOperation tro = new TransmittalOperation();
    // Setup the transmittal behavior
    TransmittalInfo ti =
        TransInfo(tro.getTransmittalInfoInterface(), "C:\\Users\\Public\\TransmittalAPITest\\");
    // Add a sheet set and the drawings referenced in it
    // Get a reference to the Sheet Set Manager object
    IAcSmSheetSetMgr sheetSetManager = new AcSmSheetSetMgr();
    // Open a sheet set (DST) file
    AcSmDatabase sheetSetDatabase =
        sheetSetManager.OpenDatabase("C:\\AutoCAD\\Sample\\Sheet Sets\\Architectural\\IRD Addition.dst", false);
    // Get all the SheetSelSets in the sheet set
    IAcSmEnumSheetSelSet sheetSelSetEnum =
        sheetSetDatabase.GetSheetSet().GetSheetSelSets().GetEnumerator();
    // Get the first SheetSelSet
    AcSmSheetSelSet sheetSelSet = sheetSelSetEnum.Next();
    AcSmSheetSelSet sheetSelSetFound = null;
    // Check to the see if it is the requested SheetSelSet, 
    // if not get the next and check
    while (sheetSelSet != null)
    {
        if (sheetSelSet.GetName().ToUpper().Equals("ELEVATIONS") == true)
        {
            sheetSelSetFound = sheetSelSet;
        }
        sheetSelSet = sheetSelSetEnum.Next();
    }
    // Get the sheet set from the database and process it
    // 0 - Do not include DST file or support files referenced 
    //     by the DST file (templates, blocks, ...)
    // 1 - Include DST file, all files referenced by the 
    //     DST file, its sheets and references
    if (sheetSelSet != null)
    {
        tro.addSheetSelset(sheetSelSet, 1);
    }
    // Close the sheet set
    sheetSetManager.Close(sheetSetDatabase);
    // 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();
}
 
相关参考 | 
|Archiver|CAD开发者社区
( 苏ICP备2022047690号-1   苏公网安备32011402011833)
GMT+8, 2025-11-4 14:04
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.