Skip to content

Integrates viewer Autodesk Platform Services with Jupyter Notebooks

License

Notifications You must be signed in to change notification settings

chuongmep/jupyter-forge

Repository files navigation

Platform License: Apache PyPI PyPI - Downloads

follow on Twitter

🍫Description

Jupyter Forge is a powerful library that seamlessly integrates Autodesk Platform Services with Jupyter Notebooks, enabling interactive 3D viewing and exploration within your notebook environment.

⚡Features

  • Search Object by Name

🦞Installation

pip install jupyter-forge --upgrade

🙋🏻‍♂️Requirements

  • Python 3.9+

  • Setting Environment Variables, see Tutorial Create an App

Set Environment Variables

APS_CLIENT_ID=your_client_id
APS_CLIENT_SECRET=your_client_secret

🍽️Usage

from jupyter_forge import JupyterForge
from aps_toolkit import Auth

urn = "dXJuOmFkc2sud2lwcHJvZDpmcy5maWxlOnZmLlFsa1ZtVU5RUmYtanMtd3dLQ2dLM1E_dmVyc2lvbj0x"
token = Auth().auth2leg()
forge_viewer = JupyterForge(urn, token)

## CASE 1 : NONE OBJECTS IDS ISOLATE VIEWER
forge_viewer.show(width=800, height=600)
## CASE 2 : OBJECTS IDS ISOLATE VIEWER
# object id from derivative api
object_ids = [123, 456]
forge_viewer.show(object_ids, width=800, height=600)

©️License

This project is licensed under the Apache License - see the LICENSE file for details.

💥Contributing

This is project just research in my free time and don't have any power to keep it up to date. If you want to contribute, please feel free to fork and submit a pull request.

🎁 Sponsors

Thanks JetBrains for providing a free All product IDE for this project.

Knowledge

Q&A

How can I get URN input?
  1. You can use aps-toolkit library to get URN of the item latest version.
from aps_toolkit import *

token = Auth().auth2leg()
bim360 = BIM360(token)
urn = bim360.get_latest_derivative_urn("<project_id>", "<folder_id>")
  1. You can batch report urn to dataframe from BIM360 class in aps-toolkit library.
from aps_toolkit import BIM360
from aps_toolkit import Auth

token = Auth().auth3leg()
bim360 = BIM360(token)
df = bim360.batch_report_items("<project_id>", "<folder_id>", ['.rvt'], is_sub_folder=False)

Developers

Test Data Readme

pip
install - e.

Fix server not starting

# start a server with dir 
python -m http.server 54364 --directory D:\API\Forge\jupyter-forge\src\template

Kill Port

netstat -ano | findstr :54364
taskkill /F /PID 21008
  • Kill all port relate to 54364
taskkill /F /PID 21008

Start Debug

http://localhost:54364/render.html