'-------------Start of ilogic ------------------------------------------------ On Error Resume Next 'get the path and name of the drawing file path_and_name = ThisDoc.PathAndFileName(False) ' without extension 'define oDoc oDoc = ThisDoc.Document 'specify the drawing sheet oSheet = oDoc.Sheets("Blatt:1") ' sheet by name 'oSheet = oDoc.Sheets(1) ' first sheet ' say there is a Partslist on the sheet. oPartslist = oSheet.PartsLists(1) ' create a new NameValueMap object oOptions = ThisApplication.TransientObjects.CreateNameValueMap 'specify an existing template file 'to use For formatting colors, fonts, etc MyMassagebox = MessageBox.Show("Haben Sie die richtige Stückliste auf der Zeichnung eingestellt? " & vbLf & "Menegenstückliste = Zeichnungsnorm » Mengenstückliste" & vbLf & "Stückliste = Zeichnungsnorm » Schweißstückliste" , "iLogic Info",MessageBoxButtons.YesNo,MessageBoxIcon.Question) 'Fraqge der Massegebox ja oder nein If MyMassageBox = vbYes Then 'oAuswahl = True Then oAuswahl = InputRadioBox("Stücklistenauswahl", "Mengenstückliste", "Stückliste", booleanParam, Title := "Auswahl") If oAuswahl = True Then oOptions.Value("Template") = "Q:\Inventor\Inventor2012_Vorlagen\Stücklistenvorlagen\Mengenstückliste_A4_q.xls" oOptions.Value("StartingCell") = "A8" ' export the Partslist to Excel with options oPartslist.Export(path_and_name & ".xls", _ PartsListFileFormatEnum.kMicrosoftExcel, oOptions) 'Excel Kopfparameter GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "D4") = iProperties.Value("Project", "Part Number") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "D5") = iProperties.Value("Project", "Description") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "G4") = iProperties.Value("Project", "Revision Number") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "H4") = iProperties.Value("Project", "Creation Time") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "H1") = iProperties.Value("Project" , "Designer") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "D6") = iProperties.Value("Custom", "Unterbaugruppe") Else If oAuswahl = False Then oOptions.Value("Template") = "Q:\Inventor\Inventor2012_Vorlagen\Stücklistenvorlagen\Stückliste_A4_q.xls" oOptions.Value("StartingCell") = "A8" ' export the Partslist to Excel with options oPartslist.Export(path_and_name & ".xls", _ PartsListFileFormatEnum.kMicrosoftExcel, oOptions) 'Excel Kopfparameter GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "D4") = iProperties.Value("Project", "Part Number") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "D5") = iProperties.Value("Project", "Description") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "E4") = iProperties.Value("Project", "Revision Number") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "F4") = iProperties.Value("Project", "Creation Time") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "F1") = iProperties.Value("Project" , "Designer") GoExcel.CellValue(path_and_name & ".xls", "Stückliste", "D6") = iProperties.Value("Custom", "Unterbaugruppe") End If If MyMassagebox = vbNo Then Exit Sub End If End If End If ''------ end of iLogic ----------------------------------------------------------