Set Duct Location by Endpoints

I would like to know if it is possible to modify an existing duct’s location by setting its start and endpoints. I know it’s possible to create a duct by this method. I don’t know if it’s possible to, for instance, shorten an unconnected duct with dynamo. This could probably be applied to any line based element (eg, walls) but I’m only interested in ducts right now.

Look into the Element.SetLocation node.