Quickly dimensions between different categories

Viktor, is there any way to do this?

I am trying to do the same than MARCELLO SGAMBELLURI in his class:
AS10613: More Practical Dynamo: Practical Uses for Dynamo Within Revit

At 43 mininutes, he used the script below to create quickly dimensions between structural columns and grids.

The challenge is to get the center point of the structural columns and use them how reference to dimension. Could be face too but I prefer center of columns.
I saw your replies in post https://forum.dynamobim.com/t/automatic-dimension-walls/6970/5, but I didn’t have success to change walls and openings by grids and structural columns. Thanks a lot.