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
        }

相关内容

热门资讯

透视私人局"wepo... 透视私人局"wepoker破解器激活码"agpoker辅助(总是真的有辅助app)-哔哩哔哩1、用户...
迎来新发展"wepo... 迎来新发展"wepoker辅助器是真的吗"sohoopoker辅助(一贯是有辅助app)-哔哩哔哩1...
网友热议"hhpok... 网友热议"hhpoker德州作必弊"wpk模拟器(好像真的有辅助平台)-哔哩哔哩1、在hhpoker...
长期以来"wepok... 长期以来"wepoker私人局有透视吗"WePOker有没有透视方法(本来真的有辅助神器)-哔哩哔哩...
透视苹果版"德州私人... 透视苹果版"德州私人局脚本"werplan有挂吗(原来是有辅助app)-哔哩哔哩1、首先打开德州私人...
网友热议"拱趴大菠萝... 网友热议"拱趴大菠萝开挂方法"hhpoker脚本下载(果然存在有辅助神器)-哔哩哔哩1、起透看视 拱...
迎来新发展"poke... 迎来新发展"poker辅助器免费安装"aapoker透视方法(确实是真的辅助app)-哔哩哔哩1、在...
针对"德普之星app... 针对"德普之星app安卓版破解版"wepoker私人局辅助(确实有辅助插件)-哔哩哔哩1、金币登录送...
透视真的"wepok... 透视真的"wepoker有没有机器人"wepoker辅助软件视频(好像存在有辅助辅助器)-哔哩哔哩1...
透视安装"wepok... 透视安装"wepoker数据分析工具"wepoker免费透视脚本(果然是真的辅助辅助器)-哔哩哔哩w...