Obtaining a dimension name

Morning people,

I have spent the last few days (doing a lot of reading) trying to work around this but I finally caved and need someones help.

In a drawing, I am trying to extract the dimension name and sketch number that it is located in. I want something like D1@Sketch16 (which is what is in the property manager), but if I try to get the dimension name it will leave me with D1, or if I try and use the FullName command it will give me some extra stuff after the dimension (D1@Sketch16@file.etc). Is there a way to get this? I was looking into possibly cutting off the text after the second "@" sign but I couldn't figure that out. Or is there just a way to find the sketch that a dimension is in? (Sketch16).

I need this dimension because I am trying to make a loop which slowly changes the value of D1, and spits out a driven dimension (D2).

Does anyone have any ideas? They would be greatly appreciated.

Thanks

SolidworksApi macros