For this i set the Data attribute using a var path that contains the Silverlight PAth
var pathData = //path String created by me
path["Data"] = pathData;
This does not seem to work and it throws an error.
How to set the value of Path's Data attribute dynamically/Programatically From Javscript
The basic idea seems to work for me. Two areas that could be your trouble spots, but can't really tell you more without seeing your code.
It's tricky to get a reference to any part that comes from CreateFromXaml due to namescope issues. Do you know for sure that you've got a reference to your Path?
Path strings are tricky in and of themselves. It's really more of a design output format by intention. I'm not sure I'd be trying to crank them out on the fly unless you have a library that already does that for you.