Cap Open Ends For Duc

Hello everyone. This is my first post, I hope not to be wrong and my English is not good.
Is there any way to automatically put Cap Open Ends For Duct from dynamo?
Thanks in advance