Dual color linetype

Hi,
There seems to be a connection with this post.

In general, in some software, it is possible to determine a geometry that you want to repeat along a line. Like a symbol, for example, which is multiplied along a line according to certain parameters. And then you can modify this line and the geometry adapts.

Here the base geometry would be a yellow rectangle hatch and a red rectangle hatch next to each other for exemple.

I don’t know if this would be possible in rhino, by script or grasshopper?