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
        }

相关内容

热门资讯

透视工具"wpk模拟... 透视工具"wpk模拟器多开"详细辅助解密教程(轻量版透视方法攻略)是一款可以让一直输的玩家,快速成为...
透视教学"哈糖大菠萝... 透视教学"哈糖大菠萝万能挂"详细辅助玩家教你(分析神器)是一款可以让一直输的玩家,快速成为一个“必胜...
透视透视挂"wpk私... 透视透视挂"wpk私人辅助"详细辅助透明挂教程(有挂辅助);支持多人共享记分板与复盘,通过邀请好友或...
透视新版"wpk官网... 透视新版"wpk官网下载链接"详细辅助AI教程(购买模拟器教程);科技安装教程;136704302。...
透视app"werp... 《透视app"werplan脚本"详细辅助微扑克教程(辅助器软件下载辅助)》 werplan脚本软件...
透视安装"wepok... 透视安装"wepoker软件安装包"详细辅助透视教程(辅助器激活码神器);最新版2024是一款经典耐...
透视黑科技"德普之星... 透视黑科技"德普之星透视辅助软件激活码"详细辅助专业教程(私人局透视方法方法);小薇(透视辅助)致您...
透视好友房"德普辅助... 1、透视好友房"德普辅助软件"详细辅助新版2025教程(有挂方法)。2、德普辅助软件透视辅助简单,德...
透视透视"epoke... 透视透视"epoker免费透视脚本"详细辅助可靠教程(辅助器最新版本更新内容教程);玩家必备必赢加哟...
透视实锤"wejok... 透视实锤"wejoker开挂"详细辅助细节方法(插件下载软件);亲真的是有正版授权,小编(透视辅助软...