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
        }

相关内容

热门资讯

玩家必看秘籍!奇迹陕西靖边打锅... 玩家必看秘籍!奇迹陕西靖边打锅子辅助,wpk透视辅助靠谱吗,教你攻略(有挂详细)是一款可以让一直输的...
科技通报!七千在线辅助,德州之... 科技通报!七千在线辅助,德州之星扫描器,教你攻略(有挂解密);1、点击下载安装,七千在线辅助插件透视...
新手必备!欢乐情怀辅助器,红龙... 新手必备!欢乐情怀辅助器,红龙poker作弊指令,微扑克教程(有挂解惑);欢乐情怀辅助器软件透明挂是...
玩家必看!吉祥填大坑脚本,xp... 玩家必看!吉祥填大坑脚本,xpoker怎么作弊,黑科技教程(有挂实锤);大家肯定在之前吉祥填大坑脚本...
最新技巧!天天开心王国有没有挂... 您好,天天开心王国有没有挂这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多玩...
一分钟秒懂!琼崖海南麻将辅助器... 一分钟秒懂!琼崖海南麻将辅助器,WePoKer辅助器,玩家教程(有挂教程);一分钟秒懂!琼崖海南麻将...
2分钟细说!微信小程序微乐家乡... 2分钟细说!微信小程序微乐家乡辅助器,hhpoker底牌透视脚本,必胜教程(果真有挂);1、德州微信...
分享认知!上饶辅助设备出租,w... 分享认知!上饶辅助设备出租,wepoker公共底牌,可靠技巧(确实有挂);1、让任何用户在无需AI插...
必备科技!天蝎辅助,hhpok... 必备科技!天蝎辅助,hhpoker怎么破解,分享教程(有挂神器)是一款可以让一直输的玩家,快速成为一...
重磅来袭!决战13水辅助,we... 重磅来袭!决战13水辅助,wepoker透视是真的吗,专业教程(有挂规律);是一款可以让一直输的玩家...