Create IAC MIDI port programmatically

Is it possible to create virtual MIDI port via IAC driver programmatically? If IAC driver is turned off, the script must turn it on. I suppose it can be done somehow with AppleScript. Maybe there are other ways?