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
        }

相关内容

热门资讯

备受关注的!新二号辅助软件多少... 备受关注的!新二号辅助软件多少钱,下载微乐小程序自建房透视,方案教程(发现有挂)-哔哩哔哩该软件可以...
透视黑科技!德普之星透视辅助软... 透视黑科技!德普之星透视辅助软件下载,德普之星辅助器app(透视)切实真的是有挂(有挂规律)-哔哩哔...
昨日!花花生活圈脚本,微乐自建... 昨日!花花生活圈脚本,微乐自建房辅助,指南书教程(有挂分享)-哔哩哔哩1、花花生活圈脚本脚本辅助下载...
透视安装!德普之星透视辅助,德... 透视安装!德普之星透视辅助,德普之星透视辅助插件(透视)确实存在有挂(有挂神器)-哔哩哔哩该软件可以...
针对!中至赣牌圈祈福转运,新众... 您好,中至赣牌圈祈福转运这款游戏可以开挂的,确实是有挂的,需要了解加去威信【136704302】很多...
辅助透视!德普辅助器怎么用,德... 辅助透视!德普辅助器怎么用,德扑之心免费透视(透视)原来有挂(有挂工具)-哔哩哔哩1、下载好德扑之心...
这一问题亟待解决!微信小程序微... 这一问题亟待解决!微信小程序微乐房间怎么辅助,cloudpoker怎么开挂,法子教程(有挂秘笈)-哔...
透视透视!德普之星辅助器app... 透视透视!德普之星辅助器app,德普之星透视辅助软件下载(透视)切实存在有挂(有挂攻略)-哔哩哔哩1...
据报道!四川家园辅助器,微乐自... 据报道!四川家园辅助器,微乐自建房插件详细教程,手段教程(存在有挂)-哔哩哔哩1、起透看视 微乐自建...
昨日!微信财神十三脚本,wep... 昨日!微信财神十三脚本,wepoker有没有挂,手筋教程(详细教程)-哔哩哔哩1、超多福利:超高返利...