AutodeskForge欧洲服务器用于设计自动化
创始人
2024-11-12 10:30:20
0

首先,需要在Autodesk Forge上注册一个账户获取access token来访问API。然后,使用以下代码示例创建一个新的设计自动化活动并将其分配到欧洲服务器:

import requests
import json

# Replace YOUR_ACCESS_TOKEN with your actual access token
headers = {'Authorization': 'Bearer YOUR_ACCESS_TOKEN', 'Content-Type': 'application/json'}

# The design automation activity payload
data = {
    "id": "MyActivity",
    "commandLine": "$(engine.path)\\InventorCoreConsole.exe /i $(args[inputFile].path) /al $(appbundles[MyApp].path)",
    "parameters": {
        "inputFile": {
            "verb": "get",
            "description": "Input Inventor file",
            "required": true,
            "localName": "$(args[inputFile].path)"
        }
    },
    "engine": "Autodesk.Inventor+23",
    "appbundles": ["MyApp+0.1"],
    "settings": {
        "script": {
            "value": "// Some script"
        }
    },
    "version": 1,
    "description": "My Activity"
}

# Make a POST request to create the activity and assign it to the European server
response = requests.post('https://developer.api.autodesk.com/da/us-east/v3/activities',
                         headers=headers, json=data)

此代码中,我们假设您在Autodesk Forge上已经创建了一个名为“MyApp”的应用程序包和复制了一个名为“InventorCoreConsole.exe”的程序文件到该应用程序包。

最后,我们使用以下代码示例提交一个新的设计自动化作业,并指定该作业在欧洲服务器上运行:

# The design automation job payload
data = {
    "activityId": "MyActivity",
    "arguments": {
        "inputFile": {
            "url": "",
            "localName": ""
        },
        "outputFile": {
            "verb": "put",
            "description": "Output Inventor file",
            "localName": "

相关内容

热门资讯

透视能赢!aapoker透视怎... 透视能赢!aapoker透视怎么用(透视)aapoker ai插件,攻略方法(有挂插件);小薇(透视...
透视神器!aapoker怎么开... 透视神器!aapoker怎么开辅助器(透视)aapoker插件,透明教程(有挂脚本)亲,关键说明,a...
透视私人局!aapoker插件... 透视私人局!aapoker插件下载(透视)aapoker如何设置胜率,2025新版(有挂细节);1、...
透视系统!aapoker怎么提... 透视系统!aapoker怎么提高中牌率(透视)aapoker免费透视脚本,辅助教程(有挂介绍);透视...
透视真的!aapoker透视脚... 透视真的!aapoker透视脚本(透视)aapoker如何设置胜率,德州论坛(有挂技巧)1、每一步都...
透视脚本!aapoker插件下... 透视脚本!aapoker插件下载(透视)aapoker透视脚本,安装教程(有挂黑科技)aapoker...
透视安装!aapoker辅助插... 透视安装!aapoker辅助插件工具(透视)aapoker辅助器是真的吗,必赢教程(有挂技巧)1、a...
透视智能ai!aapoker辅... 透视智能ai!aapoker辅助插件工具(透视)aapoker辅助器怎么用,攻略方法(有挂介绍)1、...
透视安卓版!aapoker脚本... 透视安卓版!aapoker脚本(透视)aapoker公共底牌,AI教程(有挂教程);一、aapoke...
透视透视挂!aapoker如何... 透视透视挂!aapoker如何设置胜率(透视)aapoker能控制牌吗,分享教程(有挂详情)aapo...