Yes, it is possible @britzl made a library for that called DefNet that should make it easier for you.