B360AutodeskForge无法从链接的文件中获取房间几何
创始人
2024-11-19 18:01:01
0

一种可能的解决方法是使用Autodesk Forge的Design Automation API,将链接文件打开并将房间几何信息导出为IFC或其他支持文件格式,然后在B360中导入该文件并将其用作房间几何的来源。

以下是一个示例,使用Design Automation API将链接文件中的房间几何导出为IFC文件:

import requests
import zipfile

# Your Forge App credentials
client_id = 'YOUR_CLIENT_ID'
client_secret = 'YOUR_CLIENT_SECRET'

# Your Autodesk account credentials
username = 'YOUR_USERNAME'
password = 'YOUR_PASSWORD'

# The URI of the linked file to extract geometry from
linked_file_uri = 'https://developer.api.autodesk.com/modelderivative/v2/designdata/:urn/manifest'

# Authenticate with Forge
auth_url = 'https://developer.api.autodesk.com/authentication/v1/authenticate'
payload = {
    'client_id': client_id,
    'client_secret': client_secret,
    'grant_type': 'password',
    'username': username,
    'password': password,
    'scope': 'data:read data:write bucket:create'
}
response = requests.post(auth_url, data=payload)
access_token = response.json()['access_token']

# Use Design Automation API to extract geometry from linked file
da_url = 'https://developer.api.autodesk.com/da/us-east/v3/workitems'
da_payload = {
    'activityId': 'ExportIFC',
    'arguments': {
        'linkedFileUri': linked_file_uri,
        'outputFormat': 'IFC'
    }
}
da_headers = {
    'Authorization': 'Bearer ' + access_token,
    'Content-Type': 'application/json'
}
da_response = requests.post(da_url, json=da_payload, headers=da_headers)
workitem_id = da_response.json()['id']

# Wait for Design Automation to finish and retrieve the IFC file
while True:
    workitem_url = da_url + '/' + workitem_id
    workitem_response = requests.get(workitem_url, headers=da_headers)
    workitem_status = workitem_response.json()['status']
    if workitem_status == '

相关内容

热门资讯

保存时出现了1个错误,导致这篇... 当保存文章时出现错误时,可以通过以下步骤解决问题:查看错误信息:查看错误提示信息可以帮助我们了解具体...
汇川伺服电机位置控制模式参数配... 1. 基本控制参数设置 1)设置位置控制模式   2)绝对值位置线性模...
不能访问光猫的的管理页面 光猫是现代家庭宽带网络的重要组成部分,它可以提供高速稳定的网络连接。但是,有时候我们会遇到不能访问光...
不一致的条件格式 要解决不一致的条件格式问题,可以按照以下步骤进行:确定条件格式的规则:首先,需要明确条件格式的规则是...
本地主机上的图像未显示 问题描述:在本地主机上显示图像时,图像未能正常显示。解决方法:以下是一些可能的解决方法,具体取决于问...
表格列调整大小出现问题 问题描述:表格列调整大小出现问题,无法正常调整列宽。解决方法:检查表格的布局方式是否正确。确保表格使...
表格中数据未显示 当表格中的数据未显示时,可能是由于以下几个原因导致的:HTML代码问题:检查表格的HTML代码是否正...
Android|无法访问或保存... 这个问题可能是由于权限设置不正确导致的。您需要在应用程序清单文件中添加以下代码来请求适当的权限:此外...
【NI Multisim 14...   目录 序言 一、工具栏 🍊1.“标准”工具栏 🍊 2.视图工具...
银河麒麟V10SP1高级服务器... 银河麒麟高级服务器操作系统简介: 银河麒麟高级服务器操作系统V10是针对企业级关键业务...