Is there a way to change the visual properties (ex. color) of a connection beams in Mechanical using Scripting API?
I don't think so. In theory you could do your own custom graphics to make a cylinder and change the color, but I think the color of the Mechanical beam is not available for change even in the UI (as of 24.2)