- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
i would like to export iProperties to excel and have some problems.
My intention is to have one iLogic Code that collects certain Properties of the assembly with all its sub-assemblies and all parts. My code (just a part of the data collecting):
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(40) As String 'string array for properties
Dim row As Integer 'start data row
Dim oPropSet As PropertySet
Dim oProp As Inventor.Property
Dim empty1(500) As String
For Each oDoc As Inventor.Document In oAsmDoc.AllReferencedDocuments
oPropSet = oDoc.PropertySets.Item("Design Tracking Properties")
oProp = oPropSet.Item("Part Number") '= Projekt/Status > Bauteilnummer
Data(0) = oProp.Value
oPropSet = oDoc.PropertySets.Item("Design Tracking Properties")
oProp = oPropSet.Item("Description") '= Projekt > Bezeichnung
Data(1) = oProp.Value
Data(2) = iProperties.Material
'oPropSet = oDoc.PropertySets.Item("Inventor User Defined Properties")
'oProp = oPropSet.Item("Material") '= Projekt > Bezeichnung
'Data(3) = oProp.Value
MessageBox.Show(Data(2), "iLogic",MessageBoxButtons.OK,MessageBoxIcon.Information)
row = 12+CInt(Data(12))
Next
It works, but Data(2) only collects the Material of the assembly where i start my iLogic Code.
If i try the commented code to get Data(3), the first Data sets are correct but then i get an error message:
Unbekannter Fehler (Ausnahme von HRESULT: 0x80004005 (E_FAIL))
In some parts there are no user defined properties (purchased parts), but i want the Code to run nevertheless.
Can anyone tell me how to get a loop running with different kinds of iProperties to export, regardless of whether there is a value entered or not?
Greetings
Solved! Go to Solution.