Create Level By Line Number

Currently I place the piping components on a level corresponding to the service. (How to Set Symbology of Pipeline by Service)

Is it possible to automatically create levels by the line number and insert the pipe on that level instead?

Thanks,

Shaun