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
        }

相关内容

热门资讯

开挂辅助安装"wep... 开挂辅助安装"wepoker私人局透视插件"开挂(透视)辅助平台(有挂方法) 了解更多开挂安装加(1...
开挂辅助!起点休闲辅助,德州私... 开挂辅助!起点休闲辅助,德州私人局脚本(透视)开挂辅助神器(有挂攻略);起点休闲辅助免费下载原版,在...
一分钟了解“we-poker辅... 一分钟了解“we-poker辅助”开挂(透视)辅助软件(玩家教程了解有挂)【无需打开直接搜索加薇13...
开挂辅助安装"wep... 开挂辅助安装"wepoker国外版透视"开挂(透视)辅助平台(竟然有挂);亲,wepoker国外版透...
开挂辅助!天道联盟辅助软件,p... 开挂辅助!天道联盟辅助软件,pokemmo脚本辅助器(透视)开挂辅助工具(有挂规律);天道联盟辅助软...
揭秘“we-poker辅助软件... 揭秘“we-poker辅助软件教程”开挂(透视)辅助工具(AA德州教程!有挂技巧)您好:这款游戏可以...
开挂辅助下载"wpk... 开挂辅助下载"wpk插件辅助"开挂(透视)辅助工具(的确有挂);无需打开直接搜索打开薇:136704...
开挂辅助!同乡游辅助软件下载,... 开挂辅助!同乡游辅助软件下载,德州局透视脚本下载安装最新版本(透视)开挂辅助神器(确实有挂);同乡游...
重大通报“pokemmo手机版... 重大通报“pokemmo手机版脚本”开挂(透视)辅助平台(解密教程发现有挂);无需打开直接搜索薇:1...
开挂辅助神器"德州透... 开挂辅助神器"德州透视插件"开挂(透视)辅助工具(确实有挂)>>您好:软件加136704302中薇联...