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
        }

相关内容

热门资讯

实测透视"wepok... 您好:wepoker发牌规律这款游戏可以开挂的,确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用...
实测透视"wepok... >>您好:wepoker辅助挂有没有确实是有挂的,很多玩家在这款游戏中打牌都会发现很多用户的牌特别好...
正品透视"Wepok... 您好:Wepoker最厉害三个组合的软件,软件加客服确实是有挂的,很多玩家在这款游戏中打牌都会发现很...
分析透视"wepok... 您好:wepoker开挂辅助方法这款游戏是可以开挂的,软件加【添加微信客服136704302】确实是...
实测透视"wepok... >>您好:wepoker发牌到底是不是随机软件加扣扣群确实是有挂的,很多玩家在这款游戏中打牌都会发现...
通报透视"wepok... 通报透视"wepoker辅助开挂方法"开挂(透视)辅助神器(重大通报揭秘教程)是一款可以让一直输的玩...
传授透视"WPK免费... >>>您好:,软件加微信【添加136704302】确实是有挂的,很多玩家在这款游戏中打牌都会发现很多...
教会透视"wepok... wepoker 发牌机制的原理是一款可以让一直输的玩家,快速成为一个“必胜”的ai辅助神器,有需要的...
关于透视"wepok... wepoker真能买到挂吗是一款可以让一直输的玩家,快速成为一个“必胜”的ai辅助神器,有需要的用户...
正版透视"wepOK... 您好,wepOKer能透视吗这款游戏可以开挂的,确实是有挂的,需要了解加微【136704302】很多...