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
        }

相关内容

热门资讯

透视辅助!hhpoker有辅助... 透视辅助!hhpoker有辅助的吗(透视)hhpoker底牌透视脚本(安装教程有挂详情);无需打开直...
玩家必看科普!hhpoker的... 【亲,hhpoker的辅助是真的吗 这款游戏可以开挂的,确实是有挂的,很多玩家在这款hhpoker的...
透视脚本!闲聚app辅助软件(... 透视脚本!闲聚app辅助软件(透视)wpk插件辅助(技巧教程有人有挂);无需打开直接搜索微信(136...
透视代打!雀友会广东潮汕辅助透... 【亲,雀友会广东潮汕辅助透视 这款游戏可以开挂的,确实是有挂的,很多玩家在这款雀友会广东潮汕辅助透视...
关于!微乐自建房脚本使用安全吗... 关于!微乐自建房脚本使用安全吗(透视)hhpoker透视脚本(力荐教程新版有挂);亲,微乐自建房脚本...
终于知道!微信小程序微乐辅助(... 终于知道!微信小程序微乐辅助(透视)wepoker正确养号方法(详细教程有挂总结)【无需打开直接搜索...
透视好牌!pokerworld... 透视好牌!pokerworld辅助器(透视)hhpoker视频巡查真的假的(wpk教程有挂详细) >...
发现一款!一起宁德吊蟹辅助(透... 发现一款!一起宁德吊蟹辅助(透视)拱趴大菠萝辅助方法(新2026教程有挂教程)【无需打开直接搜索加薇...
让我来分享经验!福建大玩家透视... 让我来分享经验!福建大玩家透视工具(透视)wepoker免费透视脚本(2026新版技巧真的有挂)>>...
玩家必看秘籍!黑桃k大厅辅助(... 玩家必看秘籍!黑桃k大厅辅助(透视)wpk控制牌是真的吗(必胜教程真实有挂);无需打开直接搜索加(薇...