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
        }

相关内容

热门资讯

推荐透视!约局吧如何查看是否有... 推荐透视!约局吧如何查看是否有挂,拱趴大菠萝怎么开挂(透视)原来真的是有辅助插件(哔哩哔哩)推荐透视...
据公告内容!佛手在线大菠萝技巧... 据公告内容!佛手在线大菠萝技巧,fishpoker透视底牌,一直真的有辅助软件(哔哩哔哩)1、超多福...
开挂透视!智星菠萝辅助,xpo... 开挂透视!智星菠萝辅助,xpoker辅助器(透视)真是是真的有辅助软件(哔哩哔哩)1、智星菠萝辅助模...
于此同时!佛手在线是不是有挂,... 于此同时!佛手在线是不是有挂,决战十水三辅助,都是是有辅助脚本(哔哩哔哩)1、金币登录送、破产送、升...
专业透视!pokermaste... 专业透视!pokermaster脚本,pokemmo修改器手机版(透视)其实真的有辅助app(哔哩哔...
分享透视!拱趴大菠萝作必弊方法... 分享透视!拱趴大菠萝作必弊方法,拱趴大菠萝有什么挂(透视)一贯有辅助技巧(哔哩哔哩)1)拱趴大菠萝作...
围绕透视问题!hhpoker到... 围绕透视问题!hhpoker到底可以作必弊码,欢聚水鱼智能辅助脚本怎么用,都是是真的有辅助app(哔...
了解透视!werplan脚本,... 了解透视!werplan脚本,fishpoker透视(透视)总是一直总是有辅助方法(哔哩哔哩)亲,关...
刚刚!大菠萝免费辅助,兴动互娱... 刚刚!大菠萝免费辅助,兴动互娱辅助工具靠谱吗,总是是真的有辅助神器(哔哩哔哩)兴动互娱辅助工具靠谱吗...
教你透视!德州透视是真的吗,拱... 教你透视!德州透视是真的吗,拱趴大菠萝万能挂图解(透视)果然存在有辅助脚本(哔哩哔哩)1、下载好拱趴...