Thanks Greg. I got it working by moving the dimension out side of the programing line. It must be something with the Mathcad version...it was working with the old version the way I had it in the first post.
the subscripts seem off
could you use the variable bar as a subscript
you can also use .dia := diameter(bar) = and it should show 0.50in after the + sign