Replace referenced edge of a drawing dimension through API

I am trying to write a macro that would allow me to replace one referenced edge of a dimension within a drawing through api.  The goal is to eventually have a macro that alows me to pre-select several baseline type dimesions, find the common edge they all share, and replace them with ordinate dimensions (the common edge being 0 of course).  Can anyone help me?

SolidworksApi macros