简体   繁体   English

如何将 BIM360 PushPin Extension 与 Forge Viewer 一起使用?

[英]How to use the BIM360 PushPin Extension with Forge Viewer?

I am trying to use the PushPin extension to load issues in my custom Forge viewer, I follow the steps described in the official documentation but getting the following error after calling PushPinExtension.createItem :我正在尝试使用 PushPin 扩展在我的自定义 Forge 查看器中加载问题,我按照官方文档中描述的步骤进行操作,但在调用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
};

在此处输入图像描述

Looking at the source code of that extension, it seems there is now a pushPinManager which is responsible for adding items, but I couldn't figure out quickly enough how to use it.查看该扩展的源代码,似乎现在有一个pushPinManager负责添加项目,但我无法足够快地弄清楚如何使用它。

It would help if you could provide a working example using the latest version of that extension and also make sure your doc is up-to-date, which will avoid some tension on the third party devs side;)如果您可以使用该扩展的最新版本提供一个工作示例并确保您的文档是最新的,这将有助于避免第三方开发人员方面的一些紧张;)

:) how are you! :) 你好吗!

yes you found the truth that the document does not update with the latest change of the extension.是的,您发现文档不会随着扩展的最新更改而更新。 While the Pushpin sample has been migrated to the latest version.虽然 Pushpin 示例已迁移到最新版本。 It demos the workflow of loading issues and creating new issues with Pushpin extension.它演示了使用 Pushpin 扩展加载问题和创建新问题的工作流程。

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

Please let us know if it does not answer your question.如果它不能回答您的问题,请告诉我们。

I have forwarded the suggestion asking for document updating.我已经转发了要求更新文件的建议。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM