Rectangle or square pipe Sweep1 error

I’m trying to make rectangle or square pipe with center curve inside but Sweep1 component works only when curves are open. It cannot be exploded because I need joints like this:

When curves are joined but not closed it works fine but when curves are closed Sweep1 don’t work.

I’ve found these threads but non of these solutions work at my case.

rect.3dm (30.2 KB) (20.1 KB) (23.0 KB)

Is there a way to make it work on closed curves too?

S (21.0 KB)

Nice. Thanks! I wonder why it cannot work for both open and closed curves like pipe command in rhino. And why t parameter cannot be at 0 point.

You can simply use AddSweep1 from rhinoscriptsyntax to get the same result as rhino:

import rhinoscriptsyntax as rs
a = rs.AddSweep1(R,S, True)

S (20.2 KB)

Thanks! That’s even better.
Maybe it should be implemented to next rhino version as pipe options since almost all other cad software has it (like square tube in solidworks or inventor).