Saveas w/ References

I have a dilemna... it seems all of the api calls available are assuming the model upon which you're attempting to do a saveas operation is already saved in it's desired "configured" state.  However, that's not my case.

I have a model that's been manipulated by 3rd party software and programs I've written that is now sitting in memory.  I can't modify (save over) the original model, I need to save this one as it's currently sitting in memory.  However, saving out each individual part seems to break all the in context relations (even though these relations list the new component and feature name correctly... they're still listed as out of context).  All the api calls (that I've tried) that are designed to maintain the in context references all pull the original file, not the one in memory.

So... is there any way to do this?  I basically need to mimic the Saveas->References routine and put in a new path for all the files it lists, but w/ the api.  I can't seems to find a way to do it.

Any help is appreciated.

Thanks,
Eric

SolidworksApi macros