Automatically add sockets to long pipes

Hello guys,

I often use the piping tool for Solidworks, and it works perfectly.

Now I'm trying to setup that long straight sections of pipe are automaticly split up into specified lengths (let's say 6meter) with sockets connecting them. I could split the pipes manually and add the sockets, but I feel like it shouldn't be too hard to make this automatic.

Does anyone know a simple solution for this?