Dim oCompDef As AssemblyComponentDefinition
oCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim occ As ComponentOccurrence
Dim oFile As String
Dim oDoc As Document
For Each occ In oCompDef.Occurrences
If occ.Definition.Type = 150995200 Then
oFile = occ.ReferencedDocumentDescriptor.ReferencedFileDescriptor.FullFileName
'открываю найденную листовую деталь
oDoc = ThisApplication.Documents.Open(oFile, False)
'выгружаю DXF
fname = ThisDoc.Document.FullFileName.Remove(ThisDoc.Document.FullFileName.LastIndexOf("\")) & "\" & iProperties.Value("Project", "Part Number") & " " & iProperties.Value("Project","Description") & ".dxf"
oDataIO = ThisDoc.Document.ComponentDefinition.DataIO
sOut = "FLAT PATTERN DWG?AcadVersion=2000&INTERIORPROFILESLayer=0&OUTERPROFILELayer=0&FEATUREPROFILESLayer=0&InvisibleLayers=IV_UNCONSUMEND_SKETCHES;IV_ALTREP
_BACK;IV_ALTREP_FRONT;IV_ARC_CENTERS;IV_TOOL_CENTER_DOWN;IV_TOOL_CENTER;IV_ARC_CENTERS;IV_TANGENT;IV_BEND;IV_BEND_DOWN&SplineTolerance Double 0.01"
oDataIO.WriteDataToFile(sOut, fname)
oDoc.Update
oDoc.Save
oDoc.Close
End If
Next