I like to be abel to generate a drawing list from an Assembly. The result should be a list with PartNumber Title Date Revision ... for all the assemblys and parts in the structure that got a drawing.
I got a very well functioning iLogic rule that generates all the pdf´s in the structure, see attached file, so all I need is to add a few lines to create an excel document and then in the same loop as the pdf creation export the iProperties from the part/assy to the excel doc. It feels simple enough but it exceeds my knowledge in programming.
Please help!!
Solved! Go to Solution.
Solved by Vladimir.Ananyev. Go to Solution.
Try the following rule to debug the export of your iProperties to the Excel workbook.
It assumes that the active document is an assembly.
'open the existing excel file GoExcel.Open("c:\Temp\AAA\EXPORT.xlsx", "Sheet1") 'Print column titles in the row 2 Dim Names={"Display name", "Title", "Part Number", "Date", "Revision"} GoExcel.CellValues("A2", "E2") = Names Dim oAsmDoc As AssemblyDocument = TryCast(ThisApplication.ActiveDocument,AssemblyDocument) If oAsmDoc Is Nothing Then MessageBox.Show("Activate assembly document first", "iLogic",MessageBoxButtons.OK,MessageBoxIcon.Information) Exit Sub End If Dim Data(4) As String 'string array for properties Dim row As Integer = 3 'start data row Dim oPropSet As PropertySet Dim oProp As Inventor.Property For Each oDoc As Inventor.Document In oAsmDoc.AllReferencedDocuments 'full filename Data(0) = oDoc.FullFileName 'Title oPropSet = oDoc.PropertySets.Item("Inventor Summary Information") oProp = oPropSet.Item("Title") Data(1) = oProp.Value 'Part Number oPropSet = oDoc.PropertySets.Item("Design Tracking Properties") oProp = oPropSet.Item("Part Number") Data(2) = oProp.Value 'Date oPropSet = oDoc.PropertySets.Item("Design Tracking Properties") oProp = oPropSet.Item("Creation Time") Data(3) = oProp.Value 'Revision oPropSet = oDoc.PropertySets.Item("Inventor Summary Information") oProp = oPropSet.Item("Revision Number") Data(4) = oProp.Value GoExcel.CellValues("A" & CStr(row), "E" & CStr(row)) = Data row += 1 Next GoExcel.Save GoExcel.Close MessageBox.Show("Done", "iLogic",MessageBoxButtons.OK,MessageBoxIcon.Information) ' === end of the rule ===
Good overview of how to access iProperties is published here:
http://modthemachine.typepad.com/my_weblog/2010/02/accessing-iproperties.html
Cheers,
What are the relasionship between API and the iLogic interface? Are all the API syntax ok to use in iLogic?
I have tried to use some API code before but somtimes i get somting like "the "blabla" object does not have that "blabla".... and the iLogic interface does not give any clue to wat arguments I could use, just that what i just tried does not work...
There is a good overview in the Inventor APi vs iLogic API presented by Wayne Brill:
Hope it could help.