CAD开发者社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

ActiveX 开发指南

相关分类

AddSheetSelset Method (ActiveX/ATO)

2023-1-1 23:02| 发布者: admin| 查看: 233| 评论: 0|来自: AutoCAD

摘要: 将图纸集选择中的图形文件添加到传递集中。

将图纸集选择中的图形文件添加到传递集中。

支持的平台:仅窗口

Namespace:传输利布

组装:acETransmit20.tlb

签名

VB.NET:

object.addSheetSelset pISheetSelset, includeSSFiles

C#:

object.addSheetSelset(pISheetSelset, includeSSFiles);
对象

类型:传递操作对象

此方法适用的对象。

pISheetSelset

访问:仅输入

类型: AcSmSheetSelSet

对象在库中定义。AcSmSheetSelSetAcSmComponents

包括SSFiles

访问:仅输入

类型:

  • 0 (): 不包括 DST 文件引用的图纸集 (DST) 和支持文件False
  • 1 (): 包括图纸集 (DST) 和 DST 文件引用的支持文件True

返回值(RetVal)

无返回值。

言论

没有额外的评论。

发布信息

释放:AutoCAD 2005 及更高版本

历史

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

例子

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

路过

雷人

握手

鲜花

鸡蛋

最新评论

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

GMT+8, 2024-5-19 13:19

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部