AnsweredAssumed Answered

Is it possible to replaceDataSource of layer with dataset stored in_memory?

Question asked by graeme on Feb 14, 2012
Latest reply on Feb 26, 2012 by graeme
I've enjoyed using in_memory workspaces to speed up some Python script tools that get published as Geoprocessing Services.

The tools open MXDs and perform, among other things, an ExportToPDF.

In the MXD there is a layer that references a dataset stored on disk.

At runtime a new dataset gets created with the same schema as that above but, given a choice, I would like that new dataset to ONLY be written to the in_memory workspace.

My testing suggests that using in_memory workspaces like this is not supported by either Layer.replaceDataSource or Layer.findAndReplaceWorkspacePath.

Is there a way to replace the data souce of a layer with a feature class stored in the in_memory workspace so that it can be displayed in a map that gets exported to PDF before the in_memory workspace is deleted?

Note: After no responses here in first 12 hours or so I have also posted this to Stack Exchange GIS