[iModelJS]Open Sample iModel?

按照https://communities.bentley.com/communities/other_communities/bdn_other_communities/w/chinabdn-wiki/50995/imodel-js提供教程,对项目进行配置,执行到npm run start,simple viewer app页面可以打开,但是点击Open Sample iModel按钮后,一直就在转圈圈,无法进入到模型浏览页面,请问是什么原因?

App与iModel均已申请,并且对.env.local进行了编辑。

npm info express 

Parents Reply
  • 在你的代码中找到:

    private _onClickOpen = async () => {
    this.setState({ isLoading: true });
    let imodel: IModelConnection | undefined;
    try {
    // attempt to open the imodel
    if (this.props.offlineIModel) {
    const offlineIModel = Config.App.getString("imjs_offline_imodel");
    imodel = await SnapshotConnection.openFile(offlineIModel);
    } else {
    const info = await this.getIModelInfo();
    imodel = await RemoteBriefcaseConnection.open(info.projectId, info.imodelId, OpenMode.Readonly);
    }
    } catch (e) {
    alert(e.message);
    }
    await this.onIModelSelected(imodel);

    };

    然后将this.props.offlineIModel换成true

    将“Imjs_offline_imodel"换成一个指定bim路径。例如:d://test.bim即可。

    当然,前提是你有自己的*.bim文件。

    Answer Verified By: bhec 

Children