ilogic: Export component iproperties to excel

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
i want to export iproperties of components of an iam to an excel file.
I have found a ilogic code for this and it works fine.
I have changed the iproperties to mass and it exports but the the mass propertie losts it Units:
Maybe someone could help me.
This is the Result of the Mass-property i get:
Part Number | Date | Mass |
3307030a_003 | 28.07.2016 10:33:03 | 232.673.618.367.318 |
3307030a_002 | 28.07.2016 10:31:02 | 7.084.782 |
1001025 | 04.07.2016 10:05:15 | 14.956.997.139.373 |
1001025_003 | 04.07.2016 10:03:45 | 113.825 |
1001025_001 | 04.07.2016 09:58:26 | 497.297.139.372.957 |
1001025_002 | 04.07.2016 10:02:20 | 14004,4 |
DIN 1025 - IPBl 450-6399 | 20.03.2015 07:19:15 | 89.427.186.291.118 |
This is the result i want:
Masse |
894,272 kg |
7,085 kg |
2,327 kg |
14,957 kg |
This is my code:
GoExcel.Open("c:\Temp\AAA\EXPORT1.xlsx", "Tabelle1")
'Print column titles in the row 2
Dim Names={"Display name", "Title", "Part Number", "Date", "Material"}
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("Design Tracking Properties")
oProp = oPropSet.Item("Mass")
Data(4) = oProp.Value
'Masse
' mass = iProperties.Mass
' MessageBox.Show(mass, "Title")
' Data(4) = mass
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 ===
Maybe someone have a solution for me,
thanks Richi