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
        }

相关内容

热门资讯

透视安卓版!wepoker永久... 透视安卓版!wepoker永久免费脚本(透视)德州扑克游戏辅助(原来是有辅助神器)-哔哩哔哩1、用户...
无独有偶!福建大菠萝万能辅助器... 无独有偶!福建大菠萝万能辅助器(透视)丰城双剑必胜辅助(竟然有辅助工具)-哔哩哔哩1、完成福建大菠萝...
透视透视!wepoker智能辅... 透视透视!wepoker智能辅助插件(透视)衢州都莱罗松辅助器(一贯是有辅助神器)-哔哩哔哩1、不需...
透视肯定!wepoker怎么发... 透视肯定!wepoker怎么发冤家牌(透视)芒果辅助器(一直真的是有辅助辅助器)-哔哩哔哩1、进入到...
透视透视!we poker插件... 透视透视!we poker插件(透视)潮友会破解器(好像是有辅助平台)-哔哩哔哩1、点击下载安装,潮...
据相关数据显示!wepoker... 据相关数据显示!wepoker免费钻石(透视)皮皮辅助软件是真的吗(一贯真的有辅助神器)-哔哩哔哩该...
此事备受玩家关注!德州真人透视... 此事备受玩家关注!德州真人透视脚本(透视)山西扣点子的技巧(切实真的是有辅助app)-哔哩哔哩1、在...
透视辅助!wejoker辅助软... 透视辅助!wejoker辅助软件视频(透视)玫瑰大厅辅助(都是存在有辅助修改器)-哔哩哔哩1、下载好...
围绕透视问题!wepoker透... 围绕透视问题!wepoker透视app下载(透视)吉祥填大坑辅助(竟然存在有辅助下载)-哔哩哔哩1、...
透视教程!wepoker透视脚... 透视教程!wepoker透视脚本(透视)wepoker辅助(总是有辅助工具)-哔哩哔哩wepoker...