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
        }

相关内容

热门资讯

一分钟快速了解!hhpoker... 一分钟快速了解!hhpoker的辅助是真的吗,拱趴大菠萝万能挂,解说技巧(其实真的是有挂)-哔哩哔哩...
今日公布!wepoker线上大... 今日公布!wepoker线上大神,wepoker怎么看底牌,规律教程(一贯有挂)-哔哩哔哩;wepo...
透视游戏!hhpoker德州透... 透视游戏!hhpoker德州透视挂,wepoker透视破解版,攻略教程!(其实是有挂的)-哔哩哔哩;...
总算清楚!wepoker开辅助... 总算清楚!wepoker开辅助能查到吗,wepokerplus脚本,wepoke教程(一直是有挂的)...
透视苹果版!aapoker透视... 透视苹果版!aapoker透视脚本入口,hhpoker透视方法,AI教程(果然真的是有挂)-哔哩哔哩...
玩家必备教程!wepoker永... 玩家必备教程!wepoker永久免费脚本,聚星ai辅助工具下载,揭秘攻略(其实真的有挂)-哔哩哔哩;...
玩家必知教程!wejoker辅... 玩家必知教程!wejoker辅助软件视频,aapoker能控制牌吗,详细教程!(果然是有挂的)-哔哩...
热门推荐!werplan怎么透... 【福星临门,好运相随】;热门推荐!werplan怎么透视,德州之星扫描器,2026新版技巧(一直真的...
一分钟揭秘!wepokerpl... 一分钟揭秘!wepokerplus辅助,hh poker辅助器先试用,揭秘攻略(一贯是有挂的)-哔哩...
终于清楚!newpoker怎么... 终于清楚!newpoker怎么安装脚本,we-poker软件,力荐教程(一直是有挂的)-哔哩哔哩;1...