Hi I have had this problem in the past. The fix is before you the regenerate function is done, right at the end, add this
And like magic, your problem is solved. I don't think many people are using dimensions in macrofeatures so this issue hasn't been resolved yet. I have had an open case for 4 years on this. Their fix is to add the note in the API guide to add this code at the end of the regenerate function. This is really bad for performance especially when you have hundreds of macrofeatures in one model. Some of our models have more than 1000 macrofeatures.
Also keep in mind that solidworks will instantiate a new instance of the class that implements ISwComFeature. So if this is in your main addin class, it will create a new one that is separate from your addin.