概要 - 転送セットにファイルを追加する(ActiveX/ATO)

プロジェクトに関連する図面ファイルやその他のファイルは、転送セットに追加することができます。

ローカル ドライブまたはネットワーク ドライブに保存されている図面(DWG)ファイルを転送セットに追加することができます。TransmittalOperation オブジェクトの addDrawingFile() メソッドは、転送セットに図面ファイルを追加するために使用されます。図面ファイルが転送セットに追加されると、転送エンジンは、図面で参照されているファイルを特定するために、図面ファイルを調査します。参照されているファイルそれぞれが転送セットに追加されます。参照されているファイルの検索に使用されるパスは、参照している図面および転送セットの TransmittalInfo オブジェクトから取得されます。

次に、転送セットに図面ファイルを追加する方法を示します。

VB.NET
' Defines the file to add to the transmittal set
Dim tf As TransmittalFile = Nothing
Dim dwgFile As String = "C:\Architectural\A-01.dwg"

' Adds the drawing file to the transmittal set
tro.addDrawingFile(dwgFile, tf)
C#
// Defines the file to add to the transmittal set
TransmittalFile tf = null;
string dwgFile = "C:\\Architectural\\A-01.dwg";

// Adds the drawing file to the transmittal set
tro.addDrawingFile(dwgFile, out tf);
VBA
' Defines the file to add to the transmittal set
Dim tf As TransmittalFile
Dim dwgFile As String
dwgFile = "C:\Architectural\A-01.dwg"

' Adds the drawing file to the transmittal set
tro.addDrawingFile dwgFile, tf

シート セットから図面ファイルを追加する

個々の図面ファイルを転送セットに追加するだけでなく、シート セット(DST)ファイルによって参照されている図面ファイルも TransmittalOperation オブジェクトの archiveSheetSet()addSheets()addSheetSelSet() メソッドを使用して転送セットに追加できます。DST ファイルを使用するときは、acsmcomponents<バージョン>.tlb ファイルに格納されているシート セット マネージャ API を参照する必要があります。

注: <バージョン> を対象の AutoCAD バージョンで使用されるシート セット マネージャ API のバージョン番号に置き換えます。
VB.NET
' Add a sheet set and the drawings files it references to a transmittal set
' Gets a new instance of the Sheet Set Manager object
Dim sheetSetManager As IAcSmSheetSetMgr = New AcSmSheetSetMgr
Dim sheetSetFile as String = "C:\Architectural\Project.dst"

' Opens a sheet set (DST) file in memory
Dim sheetSetDatabase As AcSmDatabase = _
    sheetSetManager.OpenDatabase(sheetSetFile, False)

' Gets the sheet set from the database and processes it
tro.archiveSheetSet(sheetSetDatabase.GetSheetSet(), vbTrue)

' Closes the sheet set
sheetSetManager.Close(sheetSetDatabase)
C#
// Add a sheet set and the drawings files it references to a transmittal set
// Gets a new instance of the Sheet Set Manager object
IAcSmSheetSetMgr sheetSetManagerSS = new AcSmSheetSetMgr();
string sheetSetFile = "C:\\Architectural\\Project.dst";

// Opens a sheet set (DST) file in memory
AcSmDatabase sheetSetDatabaseSS = sheetSetManagerSS.OpenDatabase(sheetSetFile, false);

// Gets the sheet set from the database and processes it
tro.archiveSheetSet(sheetSetDatabaseSS.GetSheetSet(), 1);

// Closes the sheet set
sheetSetManagerSS.Close(sheetSetDatabaseSS);
VBA
' Add a sheet set and the drawings files it references to a transmittal set
' Gets a new instance of the Sheet Set Manager object
Dim sheetSetManager As New IAcSmSheetSetMgr
Dim sheetSetFile as String
sheetSetFile = "C:\Architectural\Project.dst"

' Opens a sheet set (DST) file in memory
Dim sheetSetDatabase As AcSmDatabase
Set sheetSetDatabase = sheetSetManager.OpenDatabase sheetSetFile, False

' Gets the sheet set from the database and processes it
tro.archiveSheetSet sheetSetDatabase.GetSheetSet, vbTrue

' Closes the sheet set
sheetSetManager.Close sheetSetDatabase

その他のファイルを追加する

図面ファイル以外のファイルや、図面ファイルによって参照されているものを転送セットに追加できます。たとえば、図面で使用されている標準画層とその用途の一覧を含むスプレッドシート、さらには一般的なプロジェクトの注記を含むワード プロセッサ ドキュメントも追加できます。TransmittalOperation オブジェクトの addFile() メソッドは、転送セットにファイルを追加するために使用されます。

VB.NET
' Gets a reference to the transmittal set's file graph and its root node
Dim tfg As TransmittalFilesGraph = tro.graphInterfacePtr()
Dim rootTF As TransmittalFile = tfg.getRoot()

' Defines the file to add to the transmittal set
Dim tf As TransmittalFile = Nothing
Dim file As String = "C:\Standards\layer_list.xls"

' Adds the file to the transmittal set
tro.addFile(file, rootTF, vbFalse, tf)
C#
// Gets a reference to the transmittal set's file graph and its root node
TransmittalFilesGraph tfg = tro.graphInterfacePtr();
TransmittalFile rootTF = tfg.getRoot();

// Defines the file to add to the transmittal set
TransmittalFile tf = null;
string file = "C:\\Standards\\layer_list.xls";

// Adds the file to the transmittal set
tro.addFile(file, rootTF, false, out tf);
VBA
' Gets a reference to the transmittal set's file graph and its root node
Dim tfg As TransmittalFilesGraph
Set tfg = tro.graphInterfacePtr

Dim rootTF As TransmittalFile
Set rootTF = tfg.getRoot

' Defines the file to add to the transmittal set
Dim tf As TransmittalFile
Dim file As String
file = "C:\Standards\layer_list.xls"

' Adds the file to the transmittal set
tro.addFile file, rootTF, vbFalse, tf