Hi @serpennica
Here is a quick ilogic rule that will add up the model value of all the selected dimensions. You can just paste this code into a new ilogic rule in your drawing and run it.
Also just as a tip, you can search and ask programming questions of this type on the Inventor Customization forum too:
http://forums.autodesk.com/t5/Autodesk-Inventor-Customization/bd-p/120
I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com
Dim uom As UnitsOfMeasure
uom = ThisDoc.Document.UnitsOfMeasure
oSpaces = " "
Dim oSSet As SelectSet = ThisDoc.Document.SelectSet
If oSSet.Count = 0 Then
MessageBox.Show("Select at least one dimension", "iLogic", _
MessageBoxButtons.OK,MessageBoxIcon.Information)
Exit Sub
Else
For Each obj As Object In oSSet
'filter dimensions, ignore other selected entities
If TypeOf obj Is GeneralDimension Then
Dim oDim As GeneralDimension = obj
oValue = uom.GetStringFromValue(oDim.ModelValue, kDefaultDisplayLengthUnits)
oMessage = oMessage & vbLf & oSpaces & oValue
oSumTotal = oSumTotal + oDim.ModelValue
End If
Next
End If
oSumTotal = uom.GetStringFromValue(oSumTotal, kDefaultDisplayLengthUnits)
MessageBox.Show(oMessage & vbLf & "+ _____________ " & vbLf & oSpaces & oSumTotal, "iLogic")