BIM World
A Professional BIM Learning Platform


Dynamo Parking Lot Number

In my previous post, I discussed linear numbering of parking spaces. I also introduced a method to number parking spaces within specific areas based on their respective zones. While organizing my files recently, I rediscovered this method, made some improvements, and decided to document it here.

The workflow of this Dynamo script begins by identifying the relevant parking spaces and areas based on a selected elevation and area keywords. It then extracts the boundaries of these areas, checks which parking spaces fall within each boundary, and finally counts and numbers the parking spaces accordingly.

Example:

Dynamo-Parking Area Number

Node Overview:

Dynamo-Parking Area Number

Key Points:

  1. Filtering Areas and Parking Spaces:
    You can assign parking space numbers project-wide, but to maintain better control, this script filters elements based on elevation. Before running, select an elevation. The script then checks the elevation parameters of all areas and parking spaces, filtering only those that match the selected elevation. A nuance here is that when retrieving the elevation of a parking space using the Element.GetParametersValueByName node, it returns an Element object, whereas for areas, it returns the elevation name directly. Therefore, an additional Element.Name node is used to extract the elevation name from parking spaces. After gathering elevation names for all elements, Boolean filters isolate the matching graphic elements.
  2. Determining Parking Space Locations:
    Even after filtering by elevation, some parking spaces may have height offsets. To address this, new points are created using the X and Y coordinates of each parking space combined with the elevation height. This ensures accurate spatial intersection checks with area boundaries.
  3. Obtaining Area Boundaries:
    Extracting area boundaries is challenging because there are no built-in nodes that directly provide this data. Initially, the idea was to collect all boundary lines, perform spatial checks, and define each area’s boundary from these. However, this approach proved cumbersome. Instead, a Python node was developed to extract the boundaries efficiently. After obtaining the boundaries, surfaces are generated, and intersections between parking space locations and these surfaces determine which parking spaces belong to which areas.
  4. Numbering:
    The numbering logic should be customized to fit actual project requirements. In this example, the parking spaces are numbered using the SortByKey node, sorting based on their X and Y coordinates. This results in numbering from the bottom-left to the top-right. It is important to exclude areas without parking spaces before numbering to avoid errors.

Python Node Core Code:

# Unwrap input elements
areas = UnwrapElement(IN[0])
_list = []

# Iterate through each area to get its boundary
for a in areas:
    lineList = list()
    options = SpatialElementBoundaryOptions()
    for boundaryList in a.GetBoundarySegments(options):
        for boundary in boundaryList:
            lineList.append(boundary.GetCurve().ToProtoType())
    _list.append(lineList)
OUT = _list
xuebim
Follow the latest BIM developments in the architecture industry, explore innovative building technologies, and discover cutting-edge industry insights.
← Scan with WeChat
Like(0) 打赏
BIM WORLD » Dynamo Parking Lot Number

Comment Get first!

Must log in before commenting!

 

BIM World, A Professional BIM Learning Platform

Stay updated on the latest architecture trends and share new building technologies.

Contact UsAbout Us

觉得文章有用就打赏一下小编吧

非常感谢你的打赏,我们将继续提供更多优质内容,让我们一起创建更加美好的网络世界!

支付宝扫一扫

微信扫一扫

Account Login

By signing in, you agree toUser Agreement

Sign Up