@ruben.romero Something like this?
I have posted this as a screenshot only, so you can work through the python step-by-step as you type up the code, to build an understanding of what the workflow is doing.
It is likely that you will be building further functionality based on this code, so as @Nick_Boyts has mentioned in other posts over the years Learn Python for Dynamo: The Dynamo Python Primer - #4 by Nick_Boyts , it is important to start small when introducing yourself to what python coding can do, review tutorials, search the forum and always ask when in need of assistance, as we are a community who like to help you help yourself.