Message 1 of 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello everyone,
I am having a problem applying an ilogic rule in an assembly. The assembly contains several iAssembly variants. The tables of the inserted iAssemblies also contain a “Mass” column, which specifies the weight of the respective variant. The ilogic rule is supposed to search for the weight of each variant in the assembly from its table, add them up, and insert them into the physical iProperties.
This should work, but unfortunately it does not recognize the “ActiveTableRow” command to find the column of the inserted variant in its table.
Does anyone have any ideas for improvement?
Best Regards
Fabio
Dim oAsmDoc As AssemblyDocument oAsmDoc = ThisApplication.ActiveDocument Dim totalWeight As Double = 0 For Each oOcc As ComponentOccurrence In oAsmDoc.ComponentDefinition.Occurrences Try Dim occDoc As Document = oOcc.Definition.Document If occDoc.DocumentType = kPartDocumentObject Or occDoc.DocumentType = kAssemblyDocumentObject Then If occDoc.ComponentDefinition.IsiAssemblyMember Then Dim member As iAssemblyMember = occDoc.ComponentDefinition.iAssemblyMember ' Die aktuell in der Baugruppe verwendete Variante holen Dim row As iAssemblyTableRow = member.ActiveTableRow If Not row Is Nothing Then Dim variantWeight As Double = CDbl(row("Masse").Value) totalWeight += variantWeight End If End If End If Catch ex As Exception End Try Next ' Physikalische Masse überschreiben oAsmDoc.ComponentDefinition.MassProperties.Mass = totalWeight
Solved! Go to Solution.