I'm confused. The Make XY Event Layer tool has a spatial reference parameter that does exactly what you want -- allows the user of the tool to specify the spatial reference of the XY points in their input table.
Reading "between the lines" it sounds as if you're in ModelBuilder. Perhaps you need to expose the spatial reference as a model parameter. See the help topics Exposing tool parameters as variables and Creating model parameters
Attached [ATTACH=CONFIG]29536[/ATTACH]is the Make XY Event Layer dialog. Click the icon next to Spatial Reference and you can choose the spatial reference.
Are you saying that you don't want to use the Spatial Reference dialog? That you want to provide a fixed list of spatial references (say, 4 or 5 "standard" spatial references) that the user can pick from rather than using the Spatial Reference dialog?
There is no straight-forward way to do this. You'll have to use Python. Build a custom script tool where:
- Your input spatial reference is a string parameter
- The parameter has Value List filter of the known projection names
- Inside your code, you do a look-up of the input projection name string and convert it to a spatial reference object.
- Call Make XY Event Layer passing in the spatial reference object you created.
Any listeners out there have an existing script tool that does this?