Dimension by elements

Your best option would be to use reference dimensioning. The link below is to a recent post I responded to with code on how to get a reference by it’s name. This of course would depend on how you have the element family setup in relation to the reference lines and making sure there is a named reference line at the location that you are wanting to dimension to. Example would be pulling the default “CenterLeftRight” or “CenterTopBottom” reference and dimensioning to that. If you create your own references, make sure to name them and set their reference type (i.e. strong, weak, etc). Of course there would be a little more involved, such as setting up a line for the dimension line placement location. But that too can be automated with a pick point.

In addition to this post, there are several other posts within the forum that discusses this. Just need to search for them.