Material over 2 meshes

Hello,

With geometry I can align a material over 2 brushes seemlessly. Is this possible in code with meshes?
Geometry example:

11662-screenshot00023.jpg

Ok, I have got it now myself. I just move the UV cordinates by 1 for every cube I place using a instance material.