Objects
In your objects.json file, in the "objects" array, define the CAD objects that make up your model. When you define your object, you must make the following external references:
- Type: Objects are instances of the types you define and must reference the type's id.
- Properties: The properties that characterize the object must refer to the id of properties you already defined.
- Relationships: Define any relationships between your object and other objects with the correct relationship type and a reference to their ids.
For more information, see the following "objects" schema with reference to Table 1:
{ ... "objects": [ { "id": "integer", "type": "integer", "sourceId": "guid", "properties": [ { "id": "integer", "name": "string", "val": "various data types", //consistent with data type in property definition) "dVal": "string", //optional, display text value for UI function use } ], "relationships": { <relationship-type>: `"<integer-id>"`| `["<integer-id>"]`, ... } }, ... ]}
Table 1: Objects schema
| Property | Type | Description |
|---|---|---|
"id" | Number | Give the object an id which is unique in bimpk. |
"type" | Number | Reference the id of the type the object is an instance of. |
"sourceId" | GUID/Number/String | The object's source id in the CAD application. |
"properties" | Array of Object | Pass an array of property reference objects for each of the object's properties. |
"properties.id" | Number | Copy the property definition's id you want to reference. |
"properties.name" | String | Copy the property definition's "name" value you want to reference exactly as it appears. |
"properties.val" | Many | The property's value. The value must adhere to a data type set in the property definition's "type" value. |
"properties.dVal" | String | The property's display value you want the user to see. |
"relationships" | Object | Pass property-value pairs that define any relationships the object instance has with other objects in the model, such as a level, room, or a connection to an electrical circuit. |
"relationships.relationship-code" | String/Array of String | For each relationship type, use the specific relationship code as the property and a single or array of string integers of the object's id you want to reference. |
Sample#
{ "id": 1, "type": 108, "sourceId": "dd7a8b4b-7241-4687-87aa-fd7906f76354-0003810b", "relationships": { "contained_by_spatial_structure": 53, "referenced_by_spatial_structure": [ 69 ], "hosts": [ 21 ] }, "properties": [ { "id": 55, "name": "BA_NAME", "val": "Basic Wall::Generic - 8\" Masonry" }, { "id": 54, "name": "System.elementId", "val": 229643 }, { "id": 133, "name": "WALL_STRUCTURAL_SIGNIFICANT", "val": true }, ... ], "relationships": { "aggregates" : ["4", "6"], "aggregated_by" : "20", "contained_by_spatial_structure": "20", "references_in_spatial_structure": ["7", "8"], ... }}
Relationships#
In a CAD model, model objects can relate to other objects in direction relationships, such as the following examples:
- Wall is related to Level 1
- Furniture is contained by Room
To describe these relationships, define a relationships object with the following property and value:
- Property: The relationship type you want to define.
- Value: Depending on the data type required for the relationship type, enter one of the following:
- An integer id string for the other model object in the relationship
- An array of integer id strings for each model object in the relationship.
For more information, see the following "relationships" object schema with reference to Table 2:
{ ... "objects": [ { ... "relationships": { <relationship-type>: `"<integer-id>"`| `["<integer-id>"]`, ... } }, ... ]}Table 2: Relationship types and values
| Relationship type | Data type | Model object's id for the value | Revit example |
|---|---|---|---|
"aggregates" | ["id"] | Objects your building element aggregates | Levels aggregate Rooms and Spaces. |
"aggregated_by" | "id" | Object that aggregates your building element | A Room or Space is aggregated by a Level. |
"contains_in_spatial_structure" | ["id"] | Objects your building element contains | A Room contains model elements such as walls, windows, and furniture. |
"contained_by_spatial_structure" | "id" | Object that contains your building element | A chair is contained in a Room. |
"references_in_spatial_structure" | ["id"] | Objects your building element references | Level 1 references curtain wall 1 and curtain wall 2. |
"referenced_by_spatial_structure" | ["id"] | Objects that reference your building element | Curtain wall 1 is referenced by level 1 and level 2. |
"hosts" | ["id"] | Objects your building element hosts | A wall that hosts windows and a door. |
"hosted_by" | ["id"] | Objects that host your building element | A window is hosted by a wall. |
"groups" | ["id"] | Objects your building element groups | A Model Group groups other model elements. |
"grouped_by" | ["id"] | Objects that group your building element | A model element is grouped by a Model Group. |
"contains_in_system" | ["id"] | Equipment objects your system contains | A System that contains Equipment. |
"contained_by_system" | ["id"] | System objects that contain your equipment element | Equipment that is contained by a System. |
"system_connections" | ["id"] | ||
"system_connections.system" | ["id"] | System object that contains the equipment elements you want to relate | HVAC System |
"system_connections.from_equipments" | ["id"] | Source equipment elements in a system you want to relate from in a directional relationship to other equipment elements. | Air Handling Unit, Chillers, Boilers |
"system_connections.to_equipments" | ["id"] | Target equipment elements in a system you want to relate to in a directional relationship from other equipment elements. | VAV Boxes, Fan Coil Units, Exhaust Fans |
"from_electrical_device" | "id" | Electric circuit object that contains your electrical device element | Connection from Electrical Devices to Electrical Circuit |
"to_electrical_devices" | ["id"] | Electrical device element that connects to your electric circuit element | Connection from Electrical Circuit to Electrical Devices. |
"from_electrical_circuit" | "id" | Electric circuit object that contains your electrical device element | Connection from Electrical Circuit to this Electrical Device. |
"to_electrical_circuits" | ["id"] | Electrical device elements that are part of your electrical circuit | Connection from Electrical Device to Electrical Circuit. |
"space_bounded_by" | ["id"] | Boundary elements that bound your space | Relationship between a Space and its boundaries. |
"bounding_space" | ["id"] | Spaces your building element bounds | A Building Element that bounds a Space. |
"connecting_to" | ["id"] | A source object that relates to your target object in a directional relationship | A Plumbing Fixture connecting to a Pipe |
"connected_from" | ["id"] | A target object your source object relates to in a directional relationship | A Pipe connected from a Plumbing Fixture |
"MEPconnecting_to" | ["id"] | A source MEP object that relates to your target MEP object in a directional relationship | An Electrical Outlet connecting to an Electrical Panel |
"MEPconnected_from" | ["id"] | A target MEP object your source MEP object relates to in a directional relationship | An Electrical Panel connected from an Electrical Outlet |
"composes" | ["id"] | Aggregation object that your building element is an assembly part of | A building element and the CurtainWall system it is a component part of. |
"composed_by" | ["id"] | Building elements that are the assembly parts of your aggregation object | A CurtainWall system and its component parts. |
"covers" | ["id"] | Object that physically covers your elements or spaces | A Roof covers a Space. |
"covered_by" | ["id"] | Elements or spaces your object physically covers | A Space is covered by a Roof. |
"services_buildings" | ["id"] | System that services your building or buildings | A HVAC System services a building. |
"building_serviced_by" | ["id"] | Buildings that are serviced by your system | A building services a HVAC System. |