在Bim360中,"计划"和"项目文件夹"是两个不同的概念。下面是一个解决方法,包含了一些代码示例,用于区分这两个概念。
import requests
# Bim360项目ID和访问令牌
project_id = "your_project_id"
token = "your_token"
# API请求URL
url = f"https://developer.api.autodesk.com/hq/v2/accounts/{project_id}/projects/{project_id}/plans"
# 发送GET请求获取计划列表
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
# 处理API响应
if response.status_code == 200:
plans = response.json()
for plan in plans:
print(plan["name"])
else:
print("获取计划列表失败")
import requests
# Bim360项目ID和访问令牌
project_id = "your_project_id"
token = "your_token"
# API请求URL
url = f"https://developer.api.autodesk.com/data/v1/projects/{project_id}/folders"
# 发送GET请求获取项目文件夹列表
headers = {
"Authorization": f"Bearer {token}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
# 处理API响应
if response.status_code == 200:
folders = response.json()["data"]
for folder in folders:
print(folder["attributes"]["displayName"])
else:
print("获取项目文件夹列表失败")
通过上述代码示例,您可以获得Bim360中计划和项目文件夹的列表,并根据需要进行进一步的处理和区分。请确保替换代码中的"your_project_id"和"your_token"为实际的项目ID和访问令牌。