01-06-2021
11:43 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
01-06-2021
11:43 PM
To get custom properties, you need to change the property set. To get all your custom Properties value, you need to reference them with "User defined Properties" in property set. I have added these extra lines to the above code for getting G_L. Replace the below code in Public Function.
Public Function ExportToExcel(bRows As BOMRowsEnumerator) ExcelFile ="C:\SolidCAD\Inventor Training Files\iLOGIC\Beam\Beam Assembly - BOM.xlsx" ExcelSheet = "TEST" GoExcel.CellValue(ExcelFile,ExcelSheet,"B4") = "Item" GoExcel.CellValue(ExcelFile,ExcelSheet,"C4") = "QTY" GoExcel.CellValue(ExcelFile,ExcelSheet,"D4") = "DESC" GoExcel.CellValue(ExcelFile,ExcelSheet,"E4") = "Part Number" GoExcel.CellValue(ExcelFile,ExcelSheet,"F4") = "G_L" 'add more line below as per your property requirement Dim bRow As BOMRow For Each bRow In bRows Dim rDoc As Document rDoc = bRow.ComponentDefinitions.Item(1).Document Dim docPropertySet As PropertySet docPropertySet = rDoc.PropertySets.Item("Design Tracking Properties") GoExcel.CellValue(ExcelFile,ExcelSheet,"B" & row) = bRow.ItemNumber GoExcel.CellValue(ExcelFile,ExcelSheet,"C" & row) = bRow.ItemQuantity GoExcel.CellValue(ExcelFile,ExcelSheet,"D" & row) = docPropertySet.Item("Description").Value GoExcel.CellValue(ExcelFile,ExcelSheet,"E" & row) = docPropertySet.Item("Part Number").Value 'add more line below as per your property requirement Dim docPropertySet1 As PropertySet docPropertySet1 = rDoc.PropertySets.Item("User Defined Properties")
'You can add below all your custom properties, they must be referenced with docPropertySet1
GoExcel.CellValue(ExcelFile, ExcelSheet, "F" & row) = docPropertySet1.Item("G_L").Value row = row + 1 If Not bRow.ChildRows Is Nothing Call ExportToExcel(bRow.ChildRows) End If Next GoExcel.Save GoExcel.Close GoExcel.ClearCache End Function
Hope this will be helpful
If this answer has solved your problem please ACCEPT SOLUTION and hit like if you found it helpful..!
Regards,
Dutt Thakar
LinkedIn
Regards,
Dutt Thakar