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
        }

相关内容

热门资讯

玩家必看科普"hhp... 玩家必看科普"hhpoker辅助挂是真的吗"开挂(平台)辅助平台有挂规律-第三方教程1、下载安装好h...
透视苹果版"樱花之盛... 透视苹果版"樱花之盛辅助器下载"开挂(下载)辅助下载有挂秘笈-第三方教程;无需打开直接搜索薇:136...
我来教大家"潮汕暗宝... 您好:这款潮汕暗宝透视插件游戏是可以开挂的,确实是有挂的,很多玩家在这款潮汕暗宝透视插件游戏中打牌都...
实测发现"赣牌圈的好... 实测发现"赣牌圈的好牌几率"开挂(平台)辅助平台有挂讲解-必胜教程《详细加薇136704302咨询》...
透视工具"新西游大厅... 透视工具"新西游大厅辅助"开挂(平台)辅助平台有挂技术-微扑克教程>>您好:软件加薇13670430...
一分钟秒懂"wepo... 一分钟秒懂"wepoker代打辅助"开挂(插件)辅助插件详细教程-解密教程;无需打开直接搜索加薇13...
玩家必备科技"卡五星... >>您好:卡五星辅助器逍遥确实是有挂的,很多玩家在这款卡五星辅助器逍遥游戏中打牌都会发现很多用户的牌...
2分钟细说"闲逸辅助... 2分钟细说"闲逸辅助器"开挂(下载)辅助下载证实有挂-切实教程 【无需打开直接搜索加薇1367043...
一分钟了解"微信游戏... 一分钟了解"微信游戏锄大地辅助器"开挂(脚本)辅助脚本有挂解惑-透明挂教程;无需打开直接搜索薇:13...
透视肯定"潮友会鱼虾... 潮友会鱼虾蟹脚本辅助器 无需打开直接搜索微信:136704302本司针对手游进行,选择我们的四大理由...