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
        }

相关内容

热门资讯

微乐小程序存在有挂!微信小程序... 微乐小程序存在有挂!微信小程序多乐辅助器(开挂)教程-一直普及真的是有挂脚本下载中分为三种模型:挂靠...
微信小程序微乐破解器!微乐广西... 微信小程序微乐破解器!微乐广西麻辣辅助(开挂)攻略-其实分享真的有挂辅助器是一种具有地方特色的麻将游...
微乐小程序黑科技!微信微乐小程... 微乐小程序黑科技!微信微乐小程序有窍门吗(开挂)工具-确实分享是有挂1、每一步都需要思考,不同水平的...
微信小程序黑科技免费!微乐小程... 微信小程序黑科技免费!微乐小程序辅助器出租(开挂)方法-原来专业是有挂辅助器是一种具有地方特色的麻将...
微乐小程序黑科技!微乐广西小程... 微乐小程序黑科技!微乐广西小程序(开挂)技巧-一直分享有挂1、这是跨平台的轻量版有透视,在线的操作超...
微乐小程序存在有挂!微乐降序自... 微乐小程序存在有挂!微乐降序自建房辅助app(开挂)技巧-总是开挂真的是有挂1、游戏颠覆性的策略玩法...
微信小程序黑科技免费!微乐家乡... 微信小程序黑科技免费!微乐家乡自建房辅助app(开挂)神器-真是教你存在有挂1、破解器简单,机器人操...
微乐小程序透视辅助!微信小程序... 微乐小程序透视辅助!微信小程序游戏充值破解(开挂)工具-原来必备有挂1、有没有辅助教程、有透视吗等服...
微乐小程序黑科技!微乐自建房脚... 微乐小程序黑科技!微乐自建房脚本免费下载入口(开挂)插件-果然有挂存在有挂1、有没有辅助教程、有透视...
微乐小程序透视挂!微乐河南家乡... 微乐小程序透视挂!微乐河南家乡麻将辅助脚本(开挂)app-其实教你是有挂1、不需要AI权限,帮助你快...