Sample Code Revit Batch Processor 1.1.14 documentation
This module requires python >3.9 due to dependencies:
numpy
shapely
Gets the rotation/ translation matrix from the geometry object
geometry_object (DataGeometry
) – A data geometry object instance.
A translation matrix.
numpy array
Returns the boundary loop of an object as list of shapely points.
Points are translated with passed in matrix. Any loops containing less then 3 points will be ignored. (Empty list will be returned)
geometry_object (DataGeometry
) – A data geometry object instance.
translation_matrix (numpy array) – A translation matrix.
List of shapely points defining a polygon. (Empty list will be returned if less then 3 points in loop.)
List[shapely.point]
Returns the inner loops (holes) of an object as list of lists of shapely points.
Points are translated with passed in matrix. Any inner loops containing less then 3 points will be ignored. (Empty list will be returned)
geoObject (DataGeometry
) – A data geometry object instance.
translationM (numpy array) – A translation matrix.
List of lists of shapely points defining a polygon.
list [list[shapely.point]]
Creates shapely polygon with nested polygons from list of shapely polygons past in.
Assumptions is: first polygon describes the boundary loop and any subsequent polygons are describing holes within the boundary
shapely_polygons (list[shapely.polygon]) – list of shapely polygons
A shapely polygon.
shapely.polygon
Returns a list of of shapely polygons from data instances past in.
Polygons may contain holes
data_instance (A class with .geometry property returning a DataGeometry
instance.) – _description_
A list of shapely polygons.
list [shapely.polygon]
List of available geometry (from revit to shapely ) converters
Converts polygon points from DataGeometry instances to shapely polygon instances and returns them as a dictionary where:
key is the geometry objects id
value is a list of shapely polygons
geometry_objects (list[data object]) – A list of instances of the the same type (i.e DataRoom)
data_type (str) – string human readable identifying the data type ( each Data… class has this as a static field: dr.DataRoom.dataType)
A dictionary.
{int:[shapely.polygon]}
This module requires python >3.9 due to dependencies:
numpy
shapely
This module:
collects ceiling and room data instances by level ( assume a ceiling is always modelled as the room it is in )
converts room and ceiling outlines to shapely polygons
test for intersection of all ceilings on a given level with all rooms on a given level
stores any intersections found ( does a check how much area is intersecting…if to small its assumed its not an intended intersection)
reports all rooms and any associated ceiling(s) found
Writes Room data to file.
Note:
Room data consists of fixed (always reported) instance properties and custom instance properties defined in room_instance_property_keys
Ceiling data consists of fixed (always reported) instance properties, custom type properties defined in ceiling_type_property_keys and custom instance properties defined in ceiling_instance_property_keys
the report contains a row per associated element per room ( if 2 ceilings are in a room, the report will contain 2 rows)
data ({str:[:class: .DataRoom]}) – A dictionary where key is the level name and values is a list of DataRoom instances.
output_file_path (str) – Fully qualified file path to output report file.
room_instance_property_keys (list, optional) – Names of room instance properties to be reported, defaults to [‘Number’, ‘Name’]
ceiling_type_property_keys (list, optional) – Names of ceiling type properties to be reported, defaults to [‘Type Mark’]
ceiling_instance_property_keys (list, optional) – Names of ceiling instance properties to be reported, defaults to [‘Height Offset From Level’]
Result class instance.
Export status returned in result.status. False if an exception occurred, otherwise True.
result.message will contain the processing messages.
result.result will be an empty list
On exception:
result.status (bool) will be False.
result.message will contain the exception message.
Reads Revit data from file and runs an intersection check of each ceiling on a level with each room on the same level.
Note: DataRoom instance will contain any ceilings in that room in associated elements property.
data_source_path (str) – Fully qualified file path to json formatted file containing DataRoom and DataCeiling objects.
Result class instance.
result.status False if an exception occurred, otherwise True.
result.message will contain processing messages.
result.result A dictionary where key is the level name, value is a tuple of two lists: first one are rooms, second ones are ceiling data objects.
On exception:
result.status (bool) will be False.
result.message will contain the exception message.
result.result will be an empty list