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
        }

相关内容

热门资讯

一分钟教你!山西扣点子辅助器,... 一分钟教你!山西扣点子辅助器,决战卡五星辅助,细节开挂辅助教程(存在有挂);无需打开直接搜索加薇13...
科技介绍!小逸碰胡脚本,情怀打... 科技介绍!小逸碰胡脚本,情怀打七开辅助,分享开挂辅助教程(有挂方式);无需打开直接搜索打开薇:136...
记者发布!爱来辅助器,杭州都莱... 记者发布!爱来辅助器,杭州都莱破解版,盘点开挂辅助教程(有挂头条);无需打开直接搜索打开薇:1367...
玩家必备科普!钱塘十水三挂件,... 玩家必备科普!钱塘十水三挂件,开心泉州小程序有挂吗,细节开挂辅助教程(新版有挂);无需打开直接搜索薇...
玩家必用!蜀山四川小程序辅助,... 玩家必用!蜀山四川小程序辅助,掌电竞技辅助工具,细节开挂辅助教程(有挂方略);无需打开直接搜索薇:1...
今日科普!闲玩暗宝辅助软件,浙... 今日科普!闲玩暗宝辅助软件,浙江游戏大厅脚本修改,正品开挂辅助教程(有挂方略);无需打开直接搜索加(...
终于知道!小唐家乐园山西辅助软... 终于知道!小唐家乐园山西辅助软件,广西友乐辅助器,关于开挂辅助教程(有挂功能);无需打开直接搜索加薇...
详细说明!福建微乐小程序修改器... 详细说明!福建微乐小程序修改器,小闲川南宜宾辅助,必看开挂辅助教程(竟然有挂);无需打开直接搜索薇:...
关于!微信大a辅助,黑桃a3辅... 关于!微信大a辅助,黑桃a3辅助,正版开挂辅助教程(存在有挂);无需打开直接搜索加(薇:136704...
我来教教大家!蜀渝牌乐汇修改器... 我来教教大家!蜀渝牌乐汇修改器,河洛杠次脚本开发,曝光开挂辅助教程(有挂工具);无需打开直接搜索加薇...