简体   繁体   English

为在线查看器使用本地 Model 文件

[英]Use a Local Model file for Online Viewer

I would like to be able to use a local navisworks or revit file to be available when using an online viewer app on forge.在 Forge 上使用在线查看器应用程序时,我希望能够使用本地 navisworks 或 revit 文件。

I have so far followed the tutorial here - https://learnforge.autodesk.io/#/datamanagement/oss/ that allows me to upload a file for viewing from the client side.到目前为止,我已经按照这里的教程进行操作 - https://learnforge.autodesk.io/#/datamanagement/oss/允许我上传文件以从客户端查看。 I would like to remove the ability to upload from the client side and choose a local file to be viewed instead.我想删除从客户端上传的功能,而是选择要查看的本地文件。

I would also like to know how to remove additional buckets / objects placed from the client side from the side menu (circled in the image)我还想知道如何从侧面菜单中删除从客户端放置的其他存储桶/对象(在图像中圈出)

Thank you in advance!先感谢您!

All our sample apps work like this (eg https://github.com/Autodesk-Forge/learn.forge.viewmodels/tree/nodejs ):我们所有的示例应用程序都是这样工作的(例如https://github.com/Autodesk-Forge/learn.forge.viewmodels/tree/nodejs ):

  • all the client-side content (html, js, css) is in a specific folder (in case of nodejs samples it's called public )所有客户端内容(html、js、css)都在一个特定的文件夹中(如果是nodejs示例,则称为public
  • all the rest is part of the server-side所有 rest 都是服务器端的一部分
  • all the Forge related functionality is exposed to the client-side through server-side endpoints所有与Forge相关的功能都通过服务器端端点暴露给客户端

When the page is opened then the browser fetches the client-side components (1) - ie html, css, js files打开页面后,浏览器会获取客户端组件 (1) - 即 html、css、js 文件
When needed, the client-side code calls an endpoint on the server (2) which in turn reaches out to Forge (3) and passes back the result to the client需要时,客户端代码调用服务器上的一个端点 (2),该端点又连接到Forge (3) 并将结果传回给客户端
The only client-side part that communicates directly with Forge is the Viewer (4)直接Forge通信的唯一客户端部分是查看器(4)

在此处输入图像描述

If you want to remove some of the functionality presented to the user, you can just remove them from the client-side part (eg from the html file)如果你想删除一些呈现给用户的功能,你可以从客户端部分删除它们(例如从html文件)

In the server-side code, you can also combine multiple Forge calls: eg create a bucket, upload model file into it from the server, translate the model to SVF在服务端代码中,也可以组合多个Forge调用:比如创建一个bucket,从服务端上传model文件进去,将model翻译成SVF

If there are operations you only want to do just once (eg delete a bucket), you can also use utilities like https://oss-manager.autodesk.io/ or use this Visual Studio Code Extension : https://forge.autodesk.com/blog/forge-visual-studio-code如果您只想执行一次操作(例如删除存储桶),您还可以使用https://oss-manager.autodesk.io/等实用程序或使用此Visual Studio 代码扩展https://forge。 autodesk.com/blog/forge-visual-studio-code

If you want to add controls to the toolbar this should be of help: https://learnforge.autodesk.io/#/tutorials/extensions如果您想向工具栏添加控件,这应该会有所帮助: https://learnforge.autodesk.io/#/tutorials/extensions
If you want to add something custom then you can use HTML / CSS / JS in your client-side code to implement those如果你想添加一些自定义的东西,那么你可以在你的客户端代码中使用HTML / CSS / JS来实现这些

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

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