- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone,
I'm not the best at illogic (still learning it) and i seem to have stumped myself. I have written code to be able to select multiple parts and show an iproperties in a single message box but that not quite what I am looking for, What I am looking for is to be able to sum an iproperties and display the total in a message box. I have spent a lot of time trying to modify what I have got but with no luck. what would be the best way of handling this?
My code:
Dim oOccurrence As ComponentOccurrence
Dim Prop As String
Dim messageText As String
Try
oOccurrence = ThisDoc.Document.SelectSet.Item(1)
Catch
MessageBox.Show("Please select a component(s) before running this rule.", "iLogic")
Return
End Try
For Each oOccurrence In ThisDoc.Document.SelectSet
If TypeOf oOccurrence Is ComponentOccurrenceProxy Then
Cost = iProperties.Value(oOccurrence.NativeObject.Name, "Project", "Estimated Cost")
Else
Cost = iProperties.Value(oOccurrence.Name, "Project", "Estimated Cost")
End If
messageText = messageText &
"Cost = " & Cost
Next
MessageBox.Show(messageText, "Summary")
Solved! Go to Solution.