void DependentFiles()
{
ITransmittalOperationPtr to;
HRESULT hRes = CoCreateInstance(CLSID_TransmittalOperation, NULL, CLSCTX_INPROC_SERVER, IID_ITransmittalOperation, (void **)&to);
ITransmittalFilePtr tf;
ITransmittalInfoPtr ti;
to->getTransmittalInfoInterface(&ti);
ti->put_includeDataLinkFile(1);
ti->put_includeDGNUnderlay(1);
ti->put_includeDWFUnderlay(1);
ti->put_includeFontFile(1);
ti->put_includeImageFile(1);
ti->put_includeInventorProjectFile(1);
ti->put_includeInventorReferences(1);
ti->put_includeMaterialTextureFile(1);
ti->put_includeNestedOverlayXrefDwg(1);
ti->put_includePDFUnderlay(1);
ti->put_includePhotometricWebFile(1);
ti->put_includePlotFile(1);
ti->put_includeUnloadedXrefDwg(1);
ti->put_includeXrefDwg(1);
_bstr_t dwgFile = _T("C:\\Temp\\Sample.dwg");
AddFileReturnVal retVal;
to->addDrawingFile(dwgFile, &tf, &retVal);
if (retVal == eFileAdded)
{
ITransmittalFilesGraphPtr tfg;
to->graphInterfacePtr(&tfg);
ITransmittalFilePtr rootTF;
tfg->getRoot(&rootTF);
DisplayDependent(rootTF);
}
}
void DisplayDependent(ITransmittalFilePtr tf)
{
int numberOfDependents;
tf->get_numberOfDependents(&numberOfDependents);
for (int i = 0; i < numberOfDependents; ++i)
{
ITransmittalFilePtr childTF;
tf->getDependent(i, &childTF);
FileType ft;
childTF->get_FileType(&ft);
_bstr_t sourcePath;
childTF->get_sourcePath(sourcePath.GetAddress());
acutPrintf(_T("\n зависит %d - %s"), ft, (LPTSTR)sourcePath);
DisplayDependent(childTF);
}
}