Revit dimension replaced with new one when reselect and re-run script

Hi Everyone,

I have created a simple dynamo script for my convenience to create dimension for select objects. But once done, I have selected new set to create dimension, the old, created dimension is replaced with new selected set one.
Any help please? Thanks.

Have a look at the following post because what you are experiencing does seem to be element binding- Element Binding in Revit