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
        }

相关内容

热门资讯

更值得关注的是!wepoker... 更值得关注的是!wepoker智能辅助插件,hhpoker是内部控制吗,练习教程(有挂细节)-哔哩哔...
据报道!微乐山西脚本插件,战神... 据报道!微乐山西脚本插件,战神辅助官方,指南书教程(原来是有挂)-哔哩哔哩1、微乐山西脚本插件透视辅...
这一问题亟待解决!hhpoke... 这一问题亟待解决!hhpoker辅助挂下载,wepoker私人局透视插件,秘籍教程(有挂透明挂)-哔...
据相关数据显示!闲来辅助神器免... 据相关数据显示!闲来辅助神器免费版在哪下载,新518互游脚本,积累教程(果然确实是有挂)-哔哩哔哩暗...
最终!hhpoker辅助挂下载... 最终!hhpoker辅助挂下载,智星菠萝可以辅助吗,指南书教程(有挂方针)-哔哩哔哩智星菠萝可以辅助...
来临!决战卡五星修改器,新漫游... 来临!决战卡五星修改器,新漫游正版辅助软件,演示教程(一直真的有挂的)-哔哩哔哩1、该软件可以轻松地...
最新消息!hh poker辅助... 最新消息!hh poker辅助有用吗,wejoker免费脚本,经验教程(确实有挂)-哔哩哔哩1、每一...
截至目前!小程序游戏修改器辅助... 截至目前!小程序游戏修改器辅助,兴动游戏辅助,手筋教程(其实是真的有挂的)-哔哩哔哩一、小程序游戏修...
目前!pokermaster辅... 目前!pokermaster辅助器,xpoker辅助器,妙计教程(有挂技巧)-哔哩哔哩1、下载好po...
迎来新发展!非凡贪玩技巧,一起... 迎来新发展!非凡贪玩技巧,一起宁德钓蟹辅助器,办法教程(其实确实是有挂的)-哔哩哔哩1、迎来新发展!...