I’m currently building a Viewer API 3 module for a Rhino 7 r5.3 model. The codebase I’m using currently references these - but I would like to know where in the docs the v3 equivalents are described please?
//viewer.shapediver.com/v2/2.19.0/sdv.css
//viewer.shapediver.com/v2/2.19.0/sdv.concat.min.js
Hello @Chris_Dadd,
it seems like you want to use the workflow where you use the Viewer 3 via a CDN. You can find documentation on that here.
Is this what you were looking for?
Cheers, Michael
I didn’t realise v3 had completely changed how you provide the interface to shapediver.
So now I’ve built a Wordpress plugin using npm and webpack with webpack.config.js to generate the index.js and a viewer.js – see files in this link
But when I load the page I get some Console errors. I think I followed the guides and so not sure what I’ve done wrong. FYI I’m using a .local domain on a LocalWP site as I understand the ticket is permitted on .local domains.
Please advise.
Uncaught TypeError: Cannot read properties of undefined (reading ‘ParametricViewer’)
at window.loadShapeDiverViewer (shapediver-viewer.js:2:3212713)
at HTMLDocument. (viewer-api-test/:269:13)
window.loadShapeDiverViewer @ shapediver-viewer.js:2
(anonymous) @ viewer-api-test/:269
viewer-api-test/:1 Uncaught (in promise) Error: A listener indicated an asynchronous response by returning true, but the message channel closed before a response was received
Hello @Chris_Dadd,
yes with version 3 of the Viewer API we completely changed the structure of our API. You can see the migration guide for this here. This does also mean that the access point is now different, ParametricViewer
doesn’t exist anymore, instead the access point via the CDN is SDV
. Please also note that we now provide npm packages, which makes the development process easier.
Additionally, there are a few clear other issues in your code.
- There is no css file anymore to load additionally
- The link to the CDN is
https://viewer.shapediver.com/v3/VERSION_NUMBER/bundle.js
, where you replace theVERSION_NUMBER
with the viewer version you want to use (for example3.2.5
).
Which ShapeDiver account are you using for the embedding?
Cheers, Michael
Thanks Michael. Really appreciate this assistance. Whilst the many codepen examples focus on TS I need to use javascript for the wordpress version.
I think the confusion factor is all the steps to generate the correct js too. I had to install npm, shapediver modules, webpack etc, then create a configuration file to generate the compiled shapediver js. I thought I’d cracked it with generating the various files.
We’ve been using iframes til now but need to use the viewer app to integrate the parametric data with user accounts.
I’d like to procedurally pull the parameters too.
It’s via Colin’ Beattie’s shapediver account.
I’d like to get this first test of the viewer api showing the model in next 24hrs ideally on my test site.
If I can privately share the rhinomodel url to the model we’re working with you’ll be able to see what we’re trying to show in the api version.