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
        }

相关内容

热门资讯

教程攻略!哥哥打大a辅助辅助(... 教程攻略!哥哥打大a辅助辅助(透视)闲来山水广西辅助(详细开挂外开挂教程)1、该软件可以轻松地帮助玩...
盘点一款!!闲逸透视免费版官方... 盘点一款!!闲逸透视免费版官方入口在哪里(透视)胡乐辅助脚本是真的假的(详细开挂外开挂教程);1、盘...
必知教程!!阿拉游戏免费辅助器... 必知教程!!阿拉游戏免费辅助器(透视)闲聚大联盟辅助(详细开挂外开挂教程)1、许多玩家不知道阿拉游戏...
技术分享!潮汕来物局游戏源码(... 技术分享!潮汕来物局游戏源码(透视)决战卡五星有挂吗(详细开挂外开挂教程);技术分享!潮汕来物局游戏...
专业讨论!!多乐跑辅助(透视)... 专业讨论!!多乐跑辅助(透视)新天道作弊(详细开挂外开挂教程);1、新天道作弊ai机器人多个强度级别...
程序员教你!大当家脚本app(... 程序员教你!大当家脚本app(透视)hhpoker辅助是真的吗(详细开挂外开挂教程)1、金币登录送、...
盘点十款!逍遥辅助器卡五星(透... 盘点十款!逍遥辅助器卡五星(透视)胡乐辅助脚本(详细开挂外开挂教程)1、用户打开应用后不用登录就可以...
科技揭秘!天道联盟辅助软件(透... 科技揭秘!天道联盟辅助软件(透视)情怀宜春辅助(详细开挂外开挂教程)1、天道联盟辅助软件系统规律教程...
最新通报!桂林字牌有辅助吗(透... 最新通报!桂林字牌有辅助吗(透视)陕麻圈脚本辅助(详细开挂外开挂教程)一、桂林字牌有辅助吗软件透明挂...
技术分享!!微信茶馆辅助(透视... 技术分享!!微信茶馆辅助(透视)飞驰娱乐科技(详细开挂外开挂教程)1、玩家可以在微信茶馆辅助软件透明...