Import JSON to Revit and generate 3D Model

Import JSON to Revit and generate 3D Model

julian.obinger
Observer Observer
2,933 Views
1 Reply
Message 1 of 2

Import JSON to Revit and generate 3D Model

julian.obinger
Observer
Observer

Hello I'm new to Revit API.

 

Within my thesis i have a project where to automatically generate a Revit 3D Model from a JSON file. 

In the JSON file multible solids are described via X,Y,Z coordinates. 

I wan't to write a Revit addin where i can push a button and the following actions are performed:

- grab a JSON file from a windows explorer folder (specific location)

- Read the JSON file

- Transform each solid within the JSON file into a Revit solid

- Build up the 3D model in Revit; each solid in revit needs to be editable with common Revit tools

- Optional: Also grab the information per solid and and write it into the Revit solids. (BIM-thinking)

 

Does anyone know how to start in this project or where i can get the necessary Knowledge. 

Does anyone know how to solve this problem?

Has anyone had a simlilar task to mine in Revit already?

 

I appreciate every hint. Thanks already

2,934 Views
1 Reply
Reply (1)
Message 2 of 2

RPTHOMAS108
Mentor
Mentor

Revit doesn't create loose solids that then have meaning attached to them such as AutoCAD. It creates parametric building elements that have solid geometry associated with parameter values of the element. Meaning you don't extrude a rectangle and call it a door your place a door in a wall which brings in associated door geometry.

 

1) Transform each solid within the JSON file into a Revit solid

Easy to create solids in Revit via the API (DirectShapes) but they will not be the fully intelligent objects associated with BIM

 

2) Build up the 3D model in Revit; each solid in Revit needs to be editable with common Revit tools

The only way to create the kind of elements with the API which you can edit later in the UI is by following class specific API element creation functionality that mirrors the same UI functionality. There will be things that can be done in the UI unsupported by the API however (so there will be gaps). 

 

3) Optional: Also grab the information per solid and and write it into the Revit solids. (BIM-thinking)

Probably you need to adjust your terminology slightly. The only information a solid has is things such as it's volume and appearance. An element within a BIM model contains information and sometimes has solid geometry.

 

I think you may be reinventing the wheel slightly. IFC is the best exchange format and it would take many years to even start reconsidering a fraction of the work that has already been done for it. The only way it sounds you are setting yourself apart from IFC is in the desire to create elements that can be manipulated in Revit as if they were created manually.

 

JSON is a provisional candidate for IFC but XML is an official format and when you decompress/open a .ifcZip file you often see xml which could be turned into JSON.