Create block from XML

I want to add a feature to my Snap!Doc generator where each block will get basically the script pic for it, and display that on the documenation page. I already can get the script pic from a block using the method here, but i need to convert the XML of the block to the block morph (what I'm pretty sure I need to input to this). Hope one of you can help!

costume from script from (EDC) Script Pic Costume library

Well, that's IN Snap, I'm trying to get the script pic from code. And besides, I'm trying to find my own way by starting a small Snap world and IDE_Morph inside a hidden canvas, importing the blocks I'm generating pictures for, pulling the one I need out to the code area (or maybe going to the required category and doing from the pallette), and get the image from that morph.

I think what you're trying to do might be a little overkill. Grabbing just the script pic and putting that image on the page is a lot easier than generating script pics on the fly. Plus, if you're getting the xml from snap, it's not much work also getting the script pic.

If you do want to generate snap block images on the fly, you could try using snapblocks, but you would have to also type up the block in the snapblocks syntax and it's not 100% accurate (and there are some things snapblocks just can't do).

Like, JSDoc?

Why would you ever want to do this

For better documenation, of course.

I could also do this by asking the user to provide a zip file of the script pics for each block, and it'll grab from that if it can. Then maybe their could somehow be something in Snap! that will generate that Snap! file, in project, using the (EDC) Script Pic Costume library. However, I really hope I can get it generated on the fly, for more ease of use.

Well anyway, I figured out a way. I made a HUGE, HGUE block of code that will, on a Snap! page with the docs library for Snap!Doc, and custom blocks, download a "pictures.zip" file with each png file being the script pic of a block with the name being the block name my Snap!Doc program would extract but instead extracting it in Snap!, which will be put into the generator to finally get thge script pics. Heres the code if anyone is wondering: