-
Hello everyone good morning my client asks me if it is possible to start the application instead of from the model selected within the project, from a saved view Thanks in advance |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 1 reply
-
This should be possible. If you know which saved view you want to open up before going to the viewer, you can modify the eg: const viewCreatorOptions = useMemo(
() => ({
viewportConfigurer: async (vp: ScreenViewport) => {
if (savedView) {
const viewStateProps = savedView.savedViewData.legacyView;
const viewState = SpatialViewState.createFromProps(viewStateProps, vp.iModel);
await viewState.load();
vp.changeView(viewState);
}
},
}),
[savedView]
);
...
<Viewer
...
viewCreatorOptions={viewCreatorOptions}
/> Note, here im using the legacy saved view data, but should work with the new APIs as well |
Beta Was this translation helpful? Give feedback.
-
hi good morning thanks for the reply |
Beta Was this translation helpful? Give feedback.
-
Hi, I was finally able to load the views saved through legacy. I had problems understanding why the legacy part with the various interfaces was not developed in the example you make available for us mere mortals :-) I understand it because it also says that it will become a bit obsolete. Once I understood that it was necessary to implement all the interfaces everything went well, although I must say that there is always a slight loading of the main view before loading the viewCreatorOptions thanks thanks thanks |
Beta Was this translation helpful? Give feedback.
Hi, I was finally able to load the views saved through legacy. I had problems understanding why the legacy part with the various interfaces was not developed in the example you make available for us mere mortals :-) I understand it because it also says that it will become a bit obsolete. Once I understood that it was necessary to implement all the interfaces everything went well, although I must say that there is always a slight loading of the main view before loading the viewCreatorOptions
thanks thanks thanks