Create DynSegForServer

I created this script while at the European UC in 2013. Some user wanted to display a ton of dynseg events in a map service. At ArcGIS Server 10 the performance was not great but worked. At ArcGIS Server 10.1, the user claimed, it was not even possible. Well, in fact it is not because an analyzer blocks event layers from being published.  The analyzer was added to prevent people from publishing maps that would not render quick, but nobody documented how to publish the events efficiently. So here is the script I wrote in case it gives you any ideas.  It is self explanatory. The use case was super-easy as the intent was just to display mile markers along roads but you can see this can be applied to line events as well.