Dimension Calculations

You guys have always been able to help me in the past. I am hoping that you can this time also.
I am writing a macro, and I am having a hard time with one of the subs.
What I want is to get the value of 3 preselected dimension, store them in some variable, do some calculations with them, and then write the results to a specified custom property in SolidWorks.
Can someone either give me some code to do this, or at least point me in the right direction.
Thnx for the help.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
UPDATE---
I have since figured out how to delete and write custom properties to SolidWorks. All I need to know now is how to take a reference dimension value and store it in a variable.
Please help.
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.