Closed RubberDuckDestroyer closed 3 years ago
What operating system and browser are you using?
Would you be able to post a larger screenshot with the rest of the code in that file? Looks like you're importing and using the Viewer component from itwin-viewer-react. That component will actually call IModelApp.startup as well as Presentation.Initialize so you don't have to, so I'm curious how that CustomIModel.startup is being used.
The error you are seeing might also be a bit misleading. Could you look at your network tab and share what the response for the openForRead call is?
Hi, @pmconne OS- macOS BigSur 11.2.3. Browser: Safari & Chrome
@aruniverse That makes sense. I have attached screenshots for the full code for CustomImodel.
I could not find the openForRead call in the network tab, I've attached a screenshot of what I'm seeing on the network tab as well.
@aruniverse That makes sense. I have attached screenshots for the full code for CustomImodel.
In your componentDidMount
you call your startup
which tries to do IModelApp.startup
and Presentation.initialize
which is unneeded, because like mentioned before, the Viewer
component will do this for you; you just need to initOidc
.
The Viewer
component takes optional props for onIModelAppInit
and onIModelConnected
which you can use to register your Presentation handlers. See docs for more.
I could not find the openForRead call in the network tab, I've attached a screenshot of what I'm seeing on the network tab as well.
Are there any other requests in your network tab failing? Looks like it doesn't even get far enough to open the imodel. If so, take a look at the response and let us know what's failing and why.
Been over a month with no update, the steps defined above should resolve the issue. Closing issue for now, if issue persists we can reopen this.
Hi, I'm trying to use the frontend presentation API with a sample iModel from the website. I want to get the Element ID of an element selected by the user.
Here's a screenshot of the handler I'm trying to use:
And here is the configuration of the IModelApp.startup. (required before initialising Presentation)
I'm getting the following error:
iModels.connectionError iModels.synchronizerLink
Can someone help me out with this?