章節六 Forge 模型轉檔及進度查詢章節自主練習

練習目標

  1. 前端實作 ForgeTree.js,並完成下列功能
    • 實作 ForgeTree.js 透過 jstree.js 右鍵選單送出所選取物件(模型檔案)的轉檔工作
    • 實作 ForgeTree.js 透過 jstree.js 查詢所選取物件的轉檔進度
  2. 後端實作下列功能:
    • 透過 Forge .NET Client SDK 的 DerivativesApi 實作送出物件(模型檔案)轉檔工作的端點: POST /api/forge/modelderivative/jobs
    • 查詢轉檔工作:GET https://developer.api.autodesk.com/modelderivative/v2/designdata/{urn}/manifest

示範及說明影片

Note. 點擊下面的圖片以開啟 YouTube 影片

程式碼補充

後端

ModelDerivativeController.cs

using Autodesk.Forge;
using Autodesk.Forge.Model;
using Microsoft.AspNetCore.Mvc;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace learn_forge_webinar_sample.Controllers
{
    [ApiController]
    public class ModelDerivativeController : ControllerBase
    {
        /// <summary>
        /// Model for TranslateObject method
        /// </summary>
        public class TranslateObjectModel
        {
            public string bucketKey { get; set; }
            public string objectName { get; set; }
        }
    }
}

參考資料


回到首頁