Hi, We’re currently evaluating Shapediver and one of our requirements is the ability to access the user’s inputs on the page the Shapediver model is embedded in.
We can’t access these from the host page javascript because of CORS restrictions, and the only other option appears to be a direct download of data or an email, both of which don’t fulfill our requirements.
I’ve seen some older forum posts on here mentioning accessing the viewer API in V2 of the iFrame embed, but can’t find any documentation covering this.
The ideal solution for us would be a grasshopper component that takes a url and json input and posts the json to the url when the user clicks finish.
Is there any way to access the user inputs from the iFrame?
We are currently evaluating solutions for this type of workflows, along with our new App Builder feature, which provides iframes with more advanced user interfaces.
The ideal solution for us would be a grasshopper component that takes a url and json input and posts the json to the url when the user clicks finish.
This is a great suggestion and valuable feedback as we are working on these topics. I will let you know once we make progress.
I’m glad to hear it’s something you’ll consider implementing in the future and look forward to updates on it.
A somewhat simpler solution would be provide a “finish” button in the iFrame UI to trigger a window.postMessage() from the iFrame with the opening window as it’s target with the user inputs as the payload. This wouldn’t require a change to the grasshopper plug in, and would provide access to the user selections.
Just so I’m clear on this, there’s currently no way to access the user inputs at the designer tier, and we’ll have to upgrade to designer plus along with building the UI to allow user interaction if we want that functionality?
You are right that, at the moment, the only way to get data in and out of your embedded ShapeDiver model is through the API, available with Designer Plus subscriptions.
As I mentioned above, we are looking to add some low-code/no-code ways to do this using the App Builder. However, note that embedding the App Builder in your own website will also require a Designer Plus subscription once the beta phase is over. The difference is that the UI will be available in the App Builder without having to go through any web development.
Thanks for the update, we’ve gone ahead and upgraded to designer plus and today we’ve built a viewer api with a UI. It’s very straight forward after following the tutorial videos you’ve published along with the added bonus of having complete control over the layout/behaviour along with full control over the user experience once they’ve made their inputs.
We got a bit side lined by the iFrame and some old forum posts on here but we’ve got it figured out now.