connery,
You cannot do this with SolidWorks. SolidWorks does not completely integrate elastic analysis with its design, modeling and drafting system.
You can do what I do, which is create multiple configurations of the spring, representing free height, solid height and the various heights that will occur in your design. If you use a design table, you can analyze for force and stress. I suspect that this is what you are after.
I have not played with CosmosWorks. There may be something you could do with that.
JHG