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
        }

相关内容

热门资讯

透视攻略!wepokerplu... 透视攻略!wepokerplus辅助,wepoker游戏的安装教程(透视)总是是真的挂(哔哩哔哩)1...
透视操作!wpk辅助插件,we... 透视操作!wpk辅助插件,wepoker辅助插件功能(透视)好像是有挂(哔哩哔哩)1、点击下载安装,...
透视方案!wepoker有没有... 透视方案!wepoker有没有插件,hhpoker脚本下载(透视)一贯有挂(哔哩哔哩)1、完成wep...
透视教材!wepoker怎么看... 透视教材!wepoker怎么看牌型,pokerworld破解版下载(透视)切实真的是有挂(哔哩哔哩)...
透视项目!云扑克有透视吗,hh... 透视项目!云扑克有透视吗,hhpoker怎么破解(透视)好像真的是有挂(哔哩哔哩)暗藏猫腻,小编详细...
透视法子!wpk刷入池率脚本,... 透视法子!wpk刷入池率脚本,pokermaster破解版(透视)一直存在有挂(哔哩哔哩)1、wpk...
透视学习!wepoker俱乐部... 透视学习!wepoker俱乐部辅助,wepoker辅助器免费(透视)竟然存在有挂(哔哩哔哩)1.we...
透视法子!wepoker辅助是... 透视法子!wepoker辅助是真的假的,wepoker私局辅助(透视)确实是有挂(哔哩哔哩)1.we...
透视烘培!wepoker有人用... 透视烘培!wepoker有人用过吗,wpk有作必弊吗(透视)本来是真的挂(哔哩哔哩)1、不需要AI权...
透视法子!pokemmo脚本,... 透视法子!pokemmo脚本,红龙poker作必弊指令(透视)果然是真的挂(哔哩哔哩)1、让任何用户...