微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何在 Forge Viewer 中使用 BIM360 PushPin 扩展?

如何解决如何在 Forge Viewer 中使用 BIM360 PushPin 扩展?

我正在尝试使用 pushpin 扩展在我的自定义 Forge 查看器中加载问题,我按照 the official documentation 中描述的步骤操作,但是在调用 pushpinExtension.createItem 后出现以下错误

  issues.forEach(function (issue) {
    var issueAttributes = issue.attributes;
    var pushpinAttributes = issue.attributes.pushpin_attributes;
    // Notice the last rendering condition,which will enforce rendering the pushpin on the current sheet.
    // We simply compare the issue sheet Metadata against the current sheet.
    if (pushpinAttributes && issueAttributes.sheet_Metadata &&
          issueAttributes.sheet_Metadata.sheetGuid === viewerApp.selectedItem.guid()) {
      pushpinExtensionHandle.createItem({
        id: issue.id,// The issue ID.
        label: issueAttributes.identifier,// The value displayed when you select the pushpin.
        // The shape and color of the pushpin,in the following format: ``type-status`` (e.g.,``issues-open``).
        status: issue.type && issueAttributes.status.indexOf(issue.type) === -1 ?
                  `${issue.type}-${issueAttributes.status}` : issueAttributes.status,position: pushpinAttributes.location,// The x,y,z coordinates of the pushpin.
        type: issue.type,// The issue type.
        objectId: pushpinAttributes.object_id,// (Only for 3D models) The object the pushpin is situated on.
        viewerState: pushpinAttributes.viewer_state // The current viewer state. For example,angle,camera,zoom.
      });
    } // if
  } // forEach
};

enter image description here

查看该扩展程序的 source code,似乎现在有一个 pushpinManager 负责添加项目,但我无法很快弄清楚如何使用它。

如果您能提供一个使用该扩展程序的最新版本的工作示例,并确保您的文档是最新的,这将有所帮助,这将避免第三方开发人员方面的一些紧张;)

解决方法

:) 你好吗!

是的,您发现文档没有随扩展名的最新更改而更新。虽然图钉示例已迁移到最新版本。它演示了使用 Pushpin 扩展加载问题和创建新问题的工作流程。

https://github.com/Autodesk-Forge/forge-bim360-issues/blob/master/bim360issues/wwwroot/js/BIM360IssueExtension.js

如果它不能回答您的问题,请告诉我们。

我已经转发了要求更新文档的建议。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。