Sample Code Revit Batch Processor 1.1.11 documentation

Contents:

This Page

duHast.Revit.Rooms.Geometry package

Submodules

duHast.Revit.Rooms.Geometry.geometry module

This module contains a Revit rooms geometry extraction functions.

duHast.Revit.Rooms.Geometry.geometry.get_room_boundary_loops(revit_room, spatial_boundary_option=Autodesk.Revit.DB.SpatialElementBoundaryOptions, boundary_location=Autodesk.Revit.DB.SpatialElementBoundaryLocation.Center)

Returns all boundary loops for a rooms. Default value set to the center boundary location.

Parameters:

revit_room (Autodesk.Revit.DB.Architecture.Room) – The room.

Returns:

List of boundary loops defining the room.

Return type:

List of lists of Autodesk.Revit.DB.BoundarySegment

duHast.Revit.Rooms.Geometry.geometry.get_points_from_room_boundaries(boundary_loops)

Returns a list of lists of points representing the room boundary loops.

  • List of Lists because a room can be made up of multiple loops (holes in rooms!)

  • First nested list represents the outer boundary of a room

  • All loops are implicitly closed ( last point is not the first point again!)

Parameters:

boundary_loops (List of lists of Autodesk.Revit.DB.BoundarySegment) – List of boundary loops defining the room.

Returns:

A data geometry instance containing the points defining the boundary loop.

Return type:

DataPolygon

duHast.Revit.Rooms.Geometry.geometry.get_2d_points_from_revit_room(revit_room)

Returns a list of dataGeometry object containing points representing the flattened(2D geometry) of a room in the model. List should only have one entry.

Parameters:

revit_room (Autodesk.Revit.DB.Architecture.Room) – The room.

Returns:

A list of data geometry instance containing the points defining the boundary loop.

Return type:

list of DataGeometry

duHast.Revit.Rooms.Geometry.geometry.get_2d_points_from_all_revit_rooms(doc)

Returns a list of dataGeometry object containing points representing the flattened(2D geometry) of all the rooms in the model.

Parameters:

doc (Autodesk.Revit.DB.Document) – Current Revit model document.

Returns:

A list of data geometry instances containing the points defining the boundary loop per room.

Return type:

list of DataGeometry

duHast.Revit.Rooms.Geometry.room_spatial_elements module

Revit API utility functions for Room boundary loops and elements.

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_room_segments(room, spat_opts=Autodesk.Revit.DB.SpatialElementBoundaryOptions)

Get a rooms boundary segments with the default spatial element boundary options. :param room: The room to get for :type room: Room :return: The boundary segments of the room :rtype: List[List[BoundarySegment]]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_segment_host(rvt_doc, seg)

Get the element that the room boundary segment belongs to :param rvt_doc: The Revit document :type rvt_doc: Document :param seg: The boundary segment :type seg: BoundarySegment

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_curves_as_curve_loop(rm_crvs)

Get a list of curves as a CurveLoop object. :param rm_crvs: The curves to get for :type rm_crvs: List[Curve] :return: The curves as a CurveLoop object :rtype: CurveLoop

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_spatial_element_filter(filter_only)

Checks if there is a Wall, ModelLine or both filter and returns a list of the types to filter for. :param filter_only: The host type to filter for :type filter_only: Wall, ModelLine or both in a list :return: A list of types to filter for :rtype: List[Type] or None

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_all_segs_from_list(segments)

Get a list of curves that represents the boundary segments of a room.

Optional parameter to filter the segments by the host type (wall or room separation line). :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :param filter_only: Optional: The host type to filter for :type filter_only: Wall, ModelLine or both in a list :return: A list of curves :rtype: List[Curve]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_segment_hosts(rvt_doc, segments, filter_only=None)

Gets the host element of a boundary segment. With option to filter by the host type :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :param filter_only: Optional: The host type to filter for :type filter_only: Wall, ModelLine or both in a list :return: A list of hosts :rtype: List[Element]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_segments_as_curves(rvt_doc, segments, filter_only=None)

Get the curves that make up the boundary segments of a room. :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :param filter_only: Optional: The host type to filter for :type filter_only: Wall, ModelLine or both in a list :return: A list of curves :rtype: List[Curve]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_only_wall_segments_as_curves(rvt_doc, segments)

Get the wall segments of a room as curves. :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :return: A list of curves :rtype: List[Curve]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_only_rm_sep_lines_as_curves(rvt_doc, segments)

Get the room separation line segments of a room as curves. :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :return: A list of curves :rtype: List[Curve]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_only_wall_segments_as_walls(rvt_doc, segments)

Get the wall segments of a room as walls. :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :return: A list of walls :rtype: List[Wall]

duHast.Revit.Rooms.Geometry.room_spatial_elements.get_only_rm_sep_lines_as_model_lines(rvt_doc, segments)

Get the room separation line segments of a room as model lines. :param rvt_doc: The Revit document :type rvt_doc: Document :param segments: The boundary segments of a room :type segments: List[List[BoundarySegment]] :return: A list of model lines :rtype: List[ModelLine]

Module contents