Parameter local save and upload example

Hi Guys,

I’m a real beginner/hack when it comes to Javascript but managed to put together a couple of functions using the SD Couch demo to save a text file locally with all the current paramaters and also upload the same file back. Giving users the ability to return to a design in the same state as when they saved it.

I need this for my own use once I get a Pro SD account - but I’d thought I’d share here in case anyone else might need this in the future.

HTML and JS files in the ZIP file + FileSaver.js which is needed.

SD download_upload example.zip (4.3 KB)

2 Likes

Also a note to the Shapediver team - the demo/examples and the documentation is in varying states - I ran into issues with demos using older API versions etc.

Could be worth cleaning this up - would have saved me a few hours…

Cheers

DK

Thanks for sharing your script, that should be useful to many ShapeDiver users. We will have a way to save and load states out of the box in the future but it will take a while.

Regarding the API documentation, it would also help us if you could point to the specific broken examples or pages so we can update them faster.

I will do just that for you Mathieu, notes are in my office, I’ll send thru a message in the morning.

Thanks again guys for your awesome product, I’m firing up my Pro account this week.

Cheers

DK

You can check out this in action on my project here:

@Mathieu I will get back to you as soon as I get a chance - there is a format difference in the returned object between the version of the API I used for the original and this production project - which took me bit of work to track down.

Cheers

DK

Hi @mathieu1

I have have FINALLY got a chance to get a copy of KaroroCAD running on the new platform:

Looking amazing guys, the new layout and look of the controls are great.

As expected the changes have broken my self built save/reload state JS that was detailed in this thread.

For a design tool like KaroroCAD being able save and return to a previous model design is FUNDAMENTAL to its usability - not just a ‘nice addition’.

Two questions now come up for me:

1/ With the pending ‘death date’ for the current platform now only a week away - will all current models be killed off? Or will these remain useable but not possible to update?

2/ When can we expect the ability to save and reload ‘state’ be possible with the new platform?

I have customers who are now well into development of there products using KaroroCAD and I wont be able to keep them as clients if my only product is now no longer fit for use.

Cheers

DK

OK - thinking about this issue and looking at the txt file import and export components.

For my Plugin version of KaroroCAD I use Human UI and save/load the 150+ parameters in a JSON txt file.

If the SD Native save states solution is still a while away (lets not talk about how long parameter ordering took to fix…) I’m pretty sure I can roll my own with these download/upload TXT tools.

Dont really want to spend the time if I don’t have too tho.

Cheers

DK

The saved states solution will come soon, but in your case I am not sure it will solve your issue. You and any other shapediver user will be able to save, load and share states, but anonymous users of the iframe will not be able to do the same.

The best solution remains to adapt your js script to the new viewer, which will work without issues. You just have to adapt it to the new viewer API. If you share your script here i can probably adapt it myself.

We are evaluating built-in solutions for saving and loading parameter sets, on top of saved states, but that will take a little longer.

Please note (as i said in the other topic earlier) that any model you upload to the new platform can still be embedded using the old viewer on your website, therefore you will be able to keep using the same workflow if you don’t want to update it for now.

@mathieu1 thank you - I’ll try both solutions this week and report back.

Cheers

DK

Hi Mathieu,

I’m a bit busy this week to check over and adapt my save/reload parameters code to update it to the new API.

Please find the JS code attached if you’d get a chance to update it to the new API.

Cheers

DK

220427_DK file parameter save and load script.js.txt (2.4 KB)