Dimension Nested Components Inside a Family

I have a script that will create views of specific elements (custom Family) with nested components, It is a prefab panel with studs on it.

I need to automatically dimension the distance of the studs (nested family) in this Panel.
It is like a billion panels.

I had no luck so far.
I can create lines using dynamo that would be precisely where the dimension would be but the dimension node just can’t understand my objects(nested elements(family)).

If anyone could shine a light in the matter.


that is a plan view of the panel

the "Blue lines were created using the Line.ByStartPointEndPoint Node.
I would like to have just the dimension in the Sheet, not even in the view if possible.

I know I can do it manually, but would like to automate the task as it is very repetitive.

I was able to do it using the info from this post.:

The code I used is there. Everything else I need can be done with regular nodes.