How to create the gear with chain?

Hy,

refer to how can I connect two path? I would start with something like this:

connect two path.vcmx (196.8 KB)

Regards
Feature