AutodeskForge中未检测到模型协调冲突
创始人
2024-11-12 11:00:40
0

要检测模型协调冲突,您可以使用Autodesk Forge的Design Automation API和Model Coordination API,使用以下代码片段:

Design Automation API:

const designAutomation = new Autodesk.Forge.DesignAutomation('v3', true);
const workItemsApi = new Autodesk.Forge.WorkItemsApi();
const appBundleApi = new Autodesk.Forge.AppBundleApi();
const activityApi = new Autodesk.Forge.ActivityApi();

//create an AppBundle
const appBundleSpec = {
    id: "testApp",
    engine: "Autodesk.AutoCAD+23",
    description: "test app bundle"
};

appBundleApi.postAppBundle(appBundleSpec)
.then(function(appBundle) { 
    console.log("AppBundle created with ID: " + appBundle.id);

    //create an Activity
    const activitySpec ={
        id: "testActivity",
        appbundles: [appBundleSpec.id],
        engine: "Autodesk.AutoCAD+23",
        description: "test activity"
    };

    activityApi.postActivity(activitySpec)
    .then(function(activity) { 
        console.log("Activity created with ID: " + activity.id);

        //create a WorkItem
        const workItemsSpec = {
            activityId: activity.id,
            arguments: {
                input: {
                    url: 'input url or your model with path'
                },
                output: {
                    url: 'output url or path'
                } 
            }
        };

        workItemsApi.postWorkItem(workItemsSpec)
        .then(function(workItem) { 
            console.log("WorkItem created with ID: " + workItem.id);

            //check the status of the WorkItem
            checkWorkItemStatus(workItem.id);
        });
    });
});

function checkWorkItemStatus(id) {
    workItemsApi.getWorkItem(id)
    .then(function(workItem) {
        if(workItem.status === 'success') {
            //your model is successfully processed
        }
        else if(workItem.status === 'failed') {
            //there is some issue with your model processing
        }
        else {
            //model is being processed
            setTimeout(checkWorkItemStatus(id), 2000); //check the workitem status every 2 seconds
        }

相关内容

热门资讯

第十分钟开挂!海贝之城辅助,微... 第十分钟开挂!海贝之城辅助,微信边锋辅助软件,新2025教程-2026最新版本1、玩家可以在微信边锋...
迎来新发展!闲来辅助神器下载(... 迎来新发展!闲来辅助神器下载(辅助挂)一贯真的有挂(有挂经验)-哔哩哔哩1、下载安装好闲来辅助神器下...
第八分钟开挂!爱玩娱乐暗堡辅助... 第八分钟开挂!爱玩娱乐暗堡辅助,阿拉游戏中心辅助,教你教程-2026最新版本1、阿拉游戏中心辅助系统...
为切实保障!熊猫辅助软件(辅助... 较多好评“微乐万能挂官网”开挂(透视)辅助教程 了解更多开挂安装加(136704302)微信号是一款...
于此同时!赣牌圈控制牌型(辅助... 于此同时!赣牌圈控制牌型(辅助挂)其实是有挂的(有挂绝活)-哔哩哔哩;无需打开直接搜索微信(1367...
第九分钟开挂!欢乐达人暗堡破解... 第九分钟开挂!欢乐达人暗堡破解,雀神挂件价格,存在挂教程-2026最新版本1、超多福利:超高返利,海...
此事引发网友热议!丽水都莱脚本... 此事引发网友热议!丽水都莱脚本辅助视频(辅助挂)果然是有挂(有挂学习)-哔哩哔哩;无需打开直接搜索薇...
第二分钟开挂!同城510k修改... 第二分钟开挂!同城510k修改,小程序牵手跑得辅助,必备教程-2026最新版本1)小程序牵手跑得辅助...
据公告内容!潮汕娱手机暗宝透视... 潮汕娱手机暗宝透视 无需打开直接搜索微信:136704302本司针对手游进行,选择我们的四大理由: ...
第1分钟开挂!丽水都莱破解器是... 您好,丽水都莱破解器是真的这款游戏可以开挂的,确实是有挂的,需要了解加去威信【485275054】很...