BIM model space coding method and device based on Revit

By using Revit's BIM model spatial coding method, rooms are automatically created and verified, implementing hierarchical coding rules. This solves the problems of inconsistent spatial coding and data silos in BIM models, improves the efficiency and accuracy of component management, and ensures data consistency and reliability.

CN122065374APending Publication Date: 2026-05-19CHINA POWER CONSRTUCTION GRP GUIYANG SURVEY & DESIGN INST CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHINA POWER CONSRTUCTION GRP GUIYANG SURVEY & DESIGN INST CO LTD
Filing Date
2025-12-11
Publication Date
2026-05-19

AI Technical Summary

Technical Problem

Existing BIM models suffer from inconsistent spatial coding rules, inefficient room creation and attribute assignment, lack of automated verification mechanisms, and poor data management and model linkage, leading to problems such as inaccurate component positioning and data consistency.

Method used

By using the Revit-based BIM model spatial coding method, we can automatically identify enclosed areas, create rooms, assign attributes in batches, achieve multi-dimensional checks and verifications, establish hierarchical coding rules, and ensure that component information is synchronized with the database.

Benefits of technology

It improves the efficiency and accuracy of spatial coding, enables precise identification of components and cross-system data collaboration, and enhances the quality and reliability of BIM data flow.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122065374A_ABST
    Figure CN122065374A_ABST
Patent Text Reader

Abstract

The invention discloses a BIM (Building Information Modeling) space coding method and device based on Revit. The method comprises the following steps: creating a plurality of room objects, and distributing names and numbers for the room objects; space attributes are allocated to the building model, and attributes related to space codes are allocated to room objects of the building model, components in the room objects and components outside the room objects and located in the building function space based on the space attributes; coding the component based on a spatial coding rule; checking the room objects, and performing multi-dimensional checking on the spatial codes of the components after the room objects pass the checking; and performing error reporting, positioning and modification on the components which do not pass the inspection until all the components pass the inspection, and synchronizing the spatial coding information of the components which are verified to be qualified to a downstream business system for guiding construction positioning and operation and maintenance management. According to the invention, the efficiency and accuracy of space coding are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of BIM technology, and specifically to a spatial coding method and apparatus for BIM models based on Revit. Background Technology

[0002] The following problems exist in the current BIM model component space management in the construction engineering field, making it difficult to meet the needs of refined and standardized management.

[0003] (1) Inconsistent spatial coding rules: Existing technologies mostly adopt a three-level coding system of "building-floor-room", which has not formed a hierarchical and full-dimensional coding system, resulting in the inability to accurately locate components. The spatial coding rules data of different buildings in the same project are inconsistent, and the model data is difficult to reuse across scenarios.

[0004] (2) Inefficient room creation and attribute assignment: In existing BIM modeling, it is necessary to manually draw closed areas on the elevation plane to create rooms, and the component attributes (such as the building to which they belong and the room category) need to be added manually one by one. When the project scale is large, it is not only time-consuming and labor-intensive, but also prone to "missing or incorrect filling" due to manual operation, resulting in low accuracy of attribute assignment.

[0005] (3) Lack of spatial coding and attribute verification mechanism: Existing technology lacks automated verification methods for component spatial coding, and cannot detect problems such as "code and attribute mismatch", "code and database instance library inconsistency", "multi-value attribute pairing error" in a timely manner. When problems occur, manual investigation is required, which is inefficient and easy to miss, affecting the accuracy of subsequent operation and maintenance queries.

[0006] (4) Poor data management and model linkage: Most existing BIM models are disconnected from the database. Room information and component attributes are only stored inside the model and cannot be updated synchronously with the external database. When the model or database is modified unilaterally, "data silos" are likely to occur, resulting in inconsistencies between component spatial information and actual project progress and asset status.

[0007] Therefore, a spatial coding method and device for BIM models are needed to automate and standardize spatial coding and verification. Summary of the Invention

[0008] In view of this, the present invention provides a spatial coding method and apparatus for BIM models based on Revit, which can solve the above-mentioned technical problems.

[0009] To solve the above-mentioned technical problems, the present invention is implemented as follows.

[0010] A Revit-based spatial coding method for BIM models includes: Step S1: Obtain all usable elevations from the building model, identify enclosed areas bounded by walls within the plane defined by the elevation, and determine the upper limit elevation corresponding to the enclosed area; create several room objects based on the upper limit elevation and the enclosed area, and assign names and numbers to each room object; Step S2: When the current model is a non-building model, link its corresponding building model to the current model to obtain the room object information; when the current model is a building model, directly obtain the room object information. Assign spatial attributes to the building model, and assign space-coded related attributes to room objects, components within room objects, and components outside room objects but located in the building's functional space based on the spatial attributes. Step S3: Encode the components within the room object and the components outside the room object but located in the building's functional space based on spatial coding rules; Step S4: Inspect the room object. After the inspection is passed, perform a multi-dimensional inspection on the spatial code of the component. For components within the room object, the multi-dimensional inspection includes attribute integrity, correct pairing of room category and room number, consistency of spatial code and coding rules, and consistency of component information with the component instance library record in the database. For components outside the room object but located within the building's functional space, the multi-dimensional inspection includes consistency of spatial code and coding rules, correct pairing of functional area category and functional area location number, and consistency of component information with the component instance library record in the database. For components that fail the inspection, errors are reported and their locations are identified. Modifications are made until all components pass the inspection. The spatial coding information of the verified components is synchronized to the downstream business system to guide construction positioning and operation and maintenance management.

[0011] Preferably, in step S2, spatial coding-related attributes are assigned to room objects, components within room objects, and components outside room objects but located within the building's functional space, based on spatial attributes, wherein: Spatial attributes include globally unique identifiers and spatial location; Based on spatial attributes, spatial coding-related attributes are assigned to room objects, components within room objects, and components outside room objects but located within the building's functional space in the building model. The spatial coding-related attributes of room objects include room name and number. The spatial coding-related attributes of components within room objects include the building to which the component belongs in the modeling model, the floor to which the component belongs, room category, and room number. The spatial coding-related attributes of components outside room objects but located within the building's functional space include the building to which the component belongs in the modeling model, the floor to which the component belongs, functional area category, and functional area location number.

[0012] Preferably, when the building model changes, spatial codes are regenerated for components within each room object and components outside each room object but located within the building's functional space, and the regenerated spatial codes are checked in multiple dimensions; wherein, the changes include changes in the spatial location of the building model, changes in the attributes of each room object, and changes in the attributes related to the spatial codes of components within each room object; The step of regenerating spatial codes for components within each room object and components outside each room object but located within the building's functional space includes: encoding components based on the changed content and spatial coding rules, and updating the component instance library records in the database.

[0013] Preferably, step S3, which encodes components within each room object and components outside each room object but located within the building's functional space based on spatial coding rules, includes: For components within a room object, the spatial coding rule is to determine code groups based on the attribute values ​​related to the spatial coding of the component. The code group includes the building code corresponding to the modeling model to which the component belongs, the floor code corresponding to the component, the room category code, and the room number code. The code groups are concatenated in sequence to form the spatial code. The spatial code from left to right is the building code corresponding to the modeling model, the floor code corresponding to the component, the room category code, and the room number code. For components located outside the room object but within the building's functional space, the spatial coding rule is to determine the code group based on the attribute values ​​related to the component's spatial coding. The code group includes the building code corresponding to the model to which the component belongs, the floor code corresponding to the component, the functional area category code, and the functional area location code. The code group is assembled in sequence to form the spatial code. The spatial code, from left to right, is the building code corresponding to the model, the floor code corresponding to the component, the functional area category code, and the functional area location code.

[0014] Preferably, in step S4, inspecting the room objects includes: Check if there is a closed area below the target elevation that is enclosed by wall elements but has not been created as a room; When there is a closed area enclosed by wall elements but no room has been created, the room object will be checked and the closed area without a room will be identified and marked. Otherwise, if the room object passes the inspection, the room object is converted into a geometric entity, and components located inside the room object and components located outside the room object but within the building's functional space are selected.

[0015] Preferably, in step S4, the method for checking the attribute integrity includes: Check if the spatial attribute values ​​of a component are empty. If the spatial attribute value of a component is empty, the check result is that the attribute is incomplete; if the attribute values ​​of all spatial attributes of a component are not empty, the check result is that the attribute is complete. In step S4, the method for checking the correctness of the pairing between room category and room number includes: When both the room category and room number of a component are multi-valued attributes, check whether each attribute value of the room category corresponds one-to-one with each attribute value of the room number; if not, the check result is a pairing error; if yes, the check result is a pairing correct. In step S4, the method for checking the consistency between the spatial encoding and the encoding rules includes: The integrity of the spatial encoding is checked. If the check passes, the spatial encoding is parsed to determine whether the parsing result is consistent with the encoding rule. If yes, the spatial encoding result is consistent with the encoding rule; otherwise, the spatial encoding result is inconsistent with the encoding rule.

[0016] A Revit-based BIM model spatial encoding device, comprising: Initialization module: Configured to obtain all usable elevations from the building model, identify enclosed areas bounded by walls within the plane defined by the elevation, determine the upper limit elevation corresponding to the enclosed area; create several room objects based on the upper limit elevation and the enclosed area, and assign names and numbers to each room object; Attribute assignment module: When the current model is a non-building model, link its corresponding building model to the current model to obtain the room object information; when the current model is a building model, directly obtain the room object information. Assign spatial attributes to the building model, and assign space-coded related attributes to room objects, components within room objects, and components outside room objects but located in the building's functional space based on the spatial attributes. Encoding module: Configured to encode components within room objects and components outside room objects located within building functional spaces based on spatial encoding rules; Verification module: Configured to check room objects, and after passing the check, to perform multi-dimensional checks on the spatial codes of components; for components within room objects, multi-dimensional checks include attribute integrity, correct pairing of room category and room number, consistency of spatial code and coding rules, and consistency of component information with the component instance library records in the database; for components outside room objects but located within building functional spaces, checks include correct pairing of functional area category and functional area location number, consistency of spatial code and coding rules, and consistency of component information with the component instance library records in the database. For components that fail the inspection, errors are reported and their locations are identified. Modifications are made until all components pass the inspection. The spatial coding information of the verified components is synchronized to the downstream business system to guide construction positioning and operation and maintenance management.

[0017] The present invention provides a computer-readable storage medium storing a plurality of instructions; the plurality of instructions are used by a processor to load and execute the method as described above.

[0018] The present invention provides an electronic device, the electronic device comprising: A processor is used to execute multiple instructions; Memory, used to store multiple instructions; The plurality of instructions are to be stored in the memory and loaded and executed by the processor as described above.

[0019] Beneficial effects: 1. Improved the efficiency and accuracy of spatial coding: By automatically creating rooms, batch assigning attributes, and automatically generating codes, it completely replaces traditional manual operations, improving the efficiency of component space management by more than 80%, and eliminating human error from the source, thus increasing the accuracy of attributes and codes to more than 99%.

[0020] 2. A fully intelligent detection method has been developed: The innovative four-layer verification mechanism of "attribute integrity, pairing correctness, coding correctness, and data consistency" can automatically detect potential problems and accurately locate them, preventing errors from flowing to subsequent stages and greatly improving the quality and reliability of the entire BIM data flow.

[0021] 3. A unified spatial coding standard was established, enabling precise identification and positioning from components to assets: This invention pioneers a four-segment hierarchical coding rule: "Building Affiliation - Floor - Room Category (Functional Area Category) - Room Number (Functional Area Location Number)." Through deep integration with a database, this rule assigns a unique spatial code to each physical space. Based on this, an association mapping mechanism allows multiple components located within the same space to share this spatial code while maintaining their own independent asset identifier. This rule not only provides a clear spatial ownership reference for components but also unifies and upgrades them into a unified "asset ID card" throughout their entire lifecycle. This fundamentally solves the problem of incompatibility between codes across buildings and systems, enabling rapid and accurate location and identification of massive amounts of facilities and equipment. It provides reliable spatial location data for asset inventory, location maintenance, and cross-system data collaboration during the operation and maintenance phase. Attached Figure Description

[0022] Figure 1This is a schematic diagram of the spatial coding method for BIM models based on Revit, as described in this invention.

[0023] Figure 2 This is a schematic diagram of the floor data management interface.

[0024] Figure 3 This is a schematic diagram of the room category data management interface.

[0025] Figure 4 A schematic diagram of the room numbering data management interface.

[0026] Figure 5 This is a schematic diagram of the data management interface for a single project.

[0027] Figure 6 A schematic diagram of the interface for selecting floor plans.

[0028] Figure 7 A schematic diagram of the interface for selecting the building.

[0029] Figure 8 This is a schematic diagram of the spatial encoding information display interface.

[0030] Figure 9 This is a diagram illustrating the example of creating rooms in batches.

[0031] Figure 10 This is a schematic diagram illustrating a spatial encoding example. Detailed Implementation

[0032] The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0033] like Figure 1 As shown, this invention proposes a spatial encoding method for BIM models based on Revit, the method comprising: Step S1: Obtain all usable elevations from the building model, identify enclosed areas bounded by walls within the plane defined by the elevation, and determine the upper limit elevation corresponding to the enclosed area; create several room objects based on the upper limit elevation and the enclosed area, and assign names and numbers to each room object; Step S2: When the current model is a non-building model, link its corresponding building model to the current model to obtain the room object information; when the current model is a building model, directly obtain the room object information. Assign spatial attributes to the building model, and assign space-coded related attributes to room objects, components within room objects, and components outside room objects but located in the building's functional space based on the spatial attributes. Step S3: Encode the components within the room object and the components outside the room object but located in the building's functional space based on spatial coding rules; Step S4: Inspect the room object. After the inspection is passed, perform a multi-dimensional inspection on the spatial code of the component. For components within the room object, the multi-dimensional inspection includes attribute integrity, correct pairing of room category and room number, consistency of spatial code and coding rules, and consistency of component information with the component instance library record in the database. For components outside the room object but located within the building's functional space, the multi-dimensional inspection includes consistency of spatial code and coding rules, correct pairing of functional area category and functional area location number, and consistency of component information with the component instance library record in the database. For components that fail the inspection, errors are reported and their locations are identified. Modifications are made until all components pass the inspection. The spatial coding information of the verified components is synchronized to the downstream business system to guide construction positioning and operation and maintenance management.

[0034] In this invention, the PlanTopology interface of the Revit API is used to automatically identify the enclosed area (PlanCircuit) within the plane defined by the elevation and bounded by walls.

[0035] Further, in step S2, spatial coding-related attributes are assigned to room objects, components within room objects, and components outside room objects but located within the building's functional space, based on spatial attributes, wherein: Spatial attributes include globally unique identifiers and spatial location; Based on spatial attributes, spatial coding-related attributes are assigned to room objects, components within room objects, and components outside room objects but located within the building's functional space in the building model. The spatial coding-related attributes of room objects include room name and number. The spatial coding-related attributes of components within room objects include the building to which the component belongs in the modeling model, the floor to which the component belongs, room category, and room number. The spatial coding-related attributes of components outside room objects but located within the building's functional space include the building to which the component belongs in the modeling model, the floor to which the component belongs, functional area category, and functional area location number.

[0036] Furthermore, after assigning spatial coding-related attributes to room objects and components within the building model, various geometric elements within the room objects are extracted as associated components. Spatial attributes are added to each associated component, spatial codes are generated, and a connection to the database is established. This achieves lossless transfer and refined management of spatial information from rooms to components.

[0037] Step S4 involves reporting and locating components that fail the inspection, including: Generate a report containing the error type and location information of components that failed the inspection, and highlight the components that failed the inspection in the modeling model for modification.

[0038] Furthermore, the method also includes: when the building model changes, regenerating spatial codes for components within each room object and components outside each room object but located within the building's functional space, and performing multi-dimensional checks on the regenerated spatial codes; wherein, the changes include changes in the spatial location of the building model, changes in the attributes of each room object, and changes in the attributes related to the spatial codes of components within each room object; The step of regenerating spatial codes for components within each room object and components outside each room object but located within the building's functional space includes: encoding components based on the changed content and spatial coding rules, and updating the component instance library records in the database.

[0039] This invention establishes a consistency maintenance mechanism. When spatial information in the building model changes, the spatial coding regeneration and verification process is automatically triggered to ensure end-to-end consistency between the model, attributes, coding, and database. For example, modifications to room names or numbers, adjustments to the spatial positions of components, and changes in the building's spatial topology (such as the addition or deletion of walls leading to room merging or division) all fall under the category of changes to the building model.

[0040] This invention provides a specific embodiment for creating several room objects based on upper limit elevation and enclosed planar areas, and assigning names and numbers to each room object based on design information, such as... Figures 2-10 As shown.

[0041] (1) Elevation selection Get all elevations: Filter all elevations in the model and store them in LevelList (elevation object) and LevelNameList (elevation name). A pop-up window for selecting floor plan elevations will appear. Users can choose two modes: "Current View Elevation" mode directly selects the elevation corresponding to the currently active view; "Multiple Specified Elevations" mode selects multiple elevations from LevelNameList. The final filtered results are stored in LastLevelList (list of elevations to be processed).

[0042] New Room Creation: Automatically create a new room within an "enclosed area" (such as a space enclosed by walls) at the target elevation. The specific steps are as follows: Iterate through the target elevations: For each elevation in LastLevelList, call the room creation function.

[0043] (2) The specific steps for creating a room are: Find the closed region (PlanCircuit) based on the elevation "PlanTopology"; Create a room for each eligible area and name it automatically (e.g., "Room 1" or "F1_1"). Set the "upper limit elevation" of the room (by using the custom function FindUpLevel to find the level above the current elevation), and finally return a collection of all created rooms. Figure 9 .

[0044] This invention provides specific embodiments for adding room attribute items and values.

[0045] Linked model determination: First, the model where the room is located needs to be determined. When filtering linked instances, if no linked model is found, a pop-up window will prompt "The room component is located in this model" and the current model will be used as the "room model". Otherwise, the linked file will be used as the "room model". Shared parameter file initialization: Create a shared parameter file as a storage medium for shared parameters, associate the file with the current document, and ensure that shared parameters can be created later.

[0046] Building information configuration: The "Owned Building" setting in the spatial attributes requires the user to configure it in the owned building interface. Figure 7 Users can select and confirm. The data in the drop-down box of the building interface is obtained from the function area table in the database. The attribute value of "secondary sub-project" is extracted from the model file name and used as the default value of the building interface. Users can confirm or modify the name of "building".

[0047] Define the spatial attribute list and GUID: Spatial attributes must be bound to a fixed GUID (globally unique identifier) ​​to ensure that the attribute is uniquely identified in different models: The spatial attributes added to the spatial attribute list include "building", "floor", "room category", "room number" and "space code", and a fixed GUID is assigned to each attribute.

[0048] Batch add spatial attributes: Automatically add spatial attributes to components in each room at the target elevation. The core steps are as follows: (1) Filter target rooms For each target elevation, filter all rooms below that elevation and save them to the Rooms list.

[0049] (2) Extracting interior components For each room, convert the room into a "Solid" to determine whether a component is inside the room, filter components that intersect with the room solid (i.e., "components inside the room"), and filter out invalid components.

[0050] (3) Add attribute items to the component Based on the previously defined list of spatial attributes and GUIDs, attribute items are attached to each component. When attaching attribute items, the existing attribute items on the component are first retrieved. If the component already has the attribute item to be added, it is skipped. If it does not exist, a shared parameter is created and associated with the GUID, parameter type, and parameter group.

[0051] (4) Set attribute values: Write attribute values ​​into the component; Assign values ​​to each attribute based on the room information. The attribute value for the room category is the "name" entered in step 1, the attribute value for the room number is the "number" entered in step 1, the attribute value for the floor is the name of the elevation where the room is located, and the attribute value for the building is the name of the building confirmed by the user.

[0052] Further, step S3, encoding components within each room object and components outside each room object but located within the building's functional space based on spatial encoding rules, includes: For components within a room object, the spatial coding rule is to determine code groups based on the attribute values ​​related to the spatial coding of the component. The code group includes the building code corresponding to the modeling model to which the component belongs, the floor code corresponding to the component, the room category code, and the room number code. The code groups are concatenated in sequence to form the spatial code. The spatial code from left to right is the building code corresponding to the modeling model, the floor code corresponding to the component, the room category code, and the room number code. For components located outside the room object but within the building's functional space, the spatial coding rule is to determine the code group based on the attribute values ​​related to the component's spatial coding. The code group includes the building code corresponding to the model to which the component belongs, the floor code corresponding to the component, the functional area category code, and the functional area location code. The code group is assembled in sequence to form the spatial code. The spatial code, from left to right, is the building code corresponding to the model, the floor code corresponding to the component, the functional area category code, and the functional area location code.

[0053] Functional space components refer to components whose location and function are clearly assigned to a specific building functional space. These components have a close subordinate and binding relationship with the space they occupy. For example, lighting fixtures, air conditioning vents, smoke detectors, fire sprinklers, power sockets, and switch panels located within clearly defined room boundaries such as offices and meeting rooms, as well as office furniture and process equipment within the room, are all located and traced through their respective rooms for identification and maintenance management.

[0054] Non-functional spatial components refer to architectural elements that cannot be categorized into any specific room or clearly defined functional area. These components typically serve the public domain or lack a clear spatial affiliation. For example, lighting fixtures in a corridor serve a passageway rather than a specific room; curtain wall units on the building's exterior belong to the enclosure system rather than the interior space; large decorative chandeliers belong to a shared atrium; and exterior structures are entirely outside the building's functional spatial system. A common characteristic of these components is that their spatial attributes and service scope cannot establish a direct, exclusive subordinate relationship with a single room or specific functional area.

[0055] This invention provides an embodiment of the spatial coding rules for room components. For components located outside the room object but within the building's functional space, the coding rules are similar to those for room components.

[0056] The functional space coding for building projects adopts a hierarchical, sequential structure, consisting of five code segments: table code, building code, floor code, room category code, and room number code. These code segments are combined in a fixed order to form a unique spatial identifier for each component, as detailed below: [Table Code] + [Building Code] + [Floor Code] + [Room Category Code] + [Room Number Code] Detailed rules for each code segment: (1) Building code (6 digits) A three-tiered project attribution coding system is used to accurately locate the project hierarchy of the building to which the component is situated. Segment definition: The first two from the left: represent the individual projects to which the building belongs; The 3rd and 4th from the left: represent the sub-projects to which the building belongs; The 5th and 6th from the left represent the secondary sub-projects to which the building belongs.

[0057] (2) Floor code (4 digits) By combining "property + serial number", the physical properties and location of the component on the specified floor are clearly defined. Segmented definition: The first digit from the left: represents the physical properties of the floor, "0" indicates a floor above ground, and "1" indicates a floor below ground; The 2nd to 4th digits from the left represent the specific floor number (numbers are arranged consecutively, such as "001" for floor 1 and "002" for floor 2).

[0058] Special scenario handling: For components distributed across multiple floors (such as vertical pipes, continuous trusses, etc.), the code of the floor where the bottom of the component is located is used for coding to ensure that the coding benchmark is unique.

[0059] (3) Room category code (4 digits) The component is uniquely coded according to its room function category, reflecting the usage attributes of the space where it is located.

[0060] Based on the order in which room categories are first entered into the database, they are numbered sequentially starting from "0001". Each category corresponds to a unique code, and once the code is determined, it will not be changed.

[0061] (4) Room number code (4 digits) Based on the two-dimensional spatial scope of "building + floor", the unique identification of the room is achieved.

[0062] Within the same floor of the same building, room numbers are sequentially numbered starting from "0001" and are unique only within that floor (the same code can be reused on different floors).

[0063] (5) Coding instructions for non-functional space components Components that cannot be clearly defined by the four elements of "building, floor, room type (functional area type), and room number (functional area location number)" will not be included in this functional space coding system.

[0064] Create database tables and develop a data management interface (1) Establish database tables, including floor table (floor name, floor type, floor code), room category table (room category, room code), and room number (building, floor, room number, room number code, door number).

[0065] (2) Develop the above table management interface ( Figures 2-5 It includes CRUD (Create, Read, Update, Delete) and automatic coding functions, and automatically generates code according to the detailed rules of each code segment and the order in which data is entered into the database.

[0066] This invention provides specific embodiments for spatial encoding.

[0067] (1) Link model judgment: First, the model where the room is located needs to be determined. If no link model is found when filtering link instances, a pop-up window will prompt "The room component is located in this model" and the current model will be used as the "room model". Otherwise, the link file will be used as the "room model". (2) Floor selection: Select floor plan through the custom floor plan selection interface ( Figure 6 The system allows users to select a "target floor," supporting either "current view floor" or "manual multi-selection of floors," and ultimately stores the selected floors in LastLevelList.

[0068] (3) Component filtering: The purpose is to extract the components in each room of the target floor. Specifically, based on the floor selected by the user, the components "located in the room" of these floors are filtered out and stored in the component list and component ID list.

[0069] (4) Load database data: Read basic data such as “floor code”, “room category code”, “room number code” and “functional area information” from the database for subsequent generation of space code.

[0070] (5) Spatial code generation and assignment: Traverse the selected components, extract "building, floor, room category, and room number" from the component parameters, query the corresponding codes from the corresponding data tables in the database, and generate spatial codes according to the spatial coding rules. See Figure 10The attribute value, which serves as the spatial code, is assigned to the component and the database is updated synchronously.

[0071] In step S4, the room objects are inspected, including: Check if there is a closed area below the target elevation that is enclosed by wall elements but has not been created as a room; When there is a closed area enclosed by wall elements but no room has been created, the room object will be checked and the closed area without a room will be identified and marked. Otherwise, if the room object passes the inspection, the room object is converted into a geometric entity, and components located inside the room object and components located outside the room object but within the building's functional space are selected.

[0072] In step S4, the method for checking the integrity of the attributes includes: Check if the spatial attribute values ​​of a component are empty. If the spatial attribute value of a component is empty, the check result is that the attribute is incomplete; if the attribute values ​​of all spatial attributes of a component are not empty, the check result is that the attribute is complete.

[0073] In step S4, the method for checking the correctness of the pairing between room category and room number includes: When both the room category and room number of a component are multi-valued attributes, check whether each attribute value of the room category corresponds one-to-one with each attribute value of the room number; if not, the check result is a pairing error; if yes, the check result is a pairing correct.

[0074] In step S4, the method for checking the consistency between the spatial encoding and the encoding rules includes: The integrity of the spatial encoding is checked. If the check passes, the spatial encoding is parsed to determine whether the parsing result is consistent with the encoding rule. If yes, the spatial encoding result is consistent with the encoding rule; otherwise, the spatial encoding result is inconsistent with the encoding rule.

[0075] In step S4, the consistency check between the component information and the component instance library records in the database involves comparing the spatial attributes and spatial codes of the components in the BIM model with the pre-stored records in the component instance library of the external database item by item to ensure that the model data and database information are synchronized in real time and to break down data silos.

[0076] This invention provides specific embodiments for checking the encoding of objects in each room.

[0077] Room inspection Linked model determination: First, the model where the room is located must be determined. When filtering linked instances, if no linked model is found, a pop-up window will prompt "Room components are located in this model" and the current model will be used as the "room model". Otherwise, the linked file will be used as the "room model". Elevation selection and room filtering: First, the user selects the target elevation, then filters for rooms under that elevation. All elevations in the model are filtered and stored in LevelList (elevation objects) and LevelNameList (elevation names). A floor plan selection interface pops up, allowing the user to select "current view elevation" or "multiple specified elevations." The final filtered results are stored in LastLevelList. Room integrity verification: If the current model is a "non-linked model," it checks for "enclosed areas without created rooms" (e.g., walls enclosing areas without generated rooms) under the elevation. If found, temporary rooms are automatically created and marked as "items to be deleted" for later post-filtering processing.

[0078] For each room at a target elevation, perform component intersection checks and attribute compliance verification.

[0079] Get Room Geometry: Convert the "room" to Solid (geometric entity). If the conversion fails (e.g., the room is not closed), a pop-up message will appear and the room will be skipped.

[0080] Filtering intersecting components within a room involves two steps: initial screening and precise intersection finding. Initial screening uses Revit's built-in intersection filter, BoundingBoxIntersectsFilter, to find all components intersecting with the room entity, filtering out invalid components. Precise geometric intersection finding: For the initially screened components, BooleanOperationsUtils.ExecuteBooleanOperation performs an intersection operation between the component entity and the room entity, retaining only components that are actually within the room (avoiding false positives of "surface contact but not within the room").

[0081] Component attribute compliance verification checks whether key spatial attributes ("Building / Secondary Sub-project", "Floor", "Room Category", "Room Number") are missing from components within a room: Attribute existence verification: If a component lacks an attribute, record an "Attribute Not Added" error. Attribute value integrity verification: If a component has an attribute but its value is empty, record an "Attribute Value Not Filled" error. Error component collection: Components with non-compliant attributes are stored in ErrorElements (Error Component List) and ErrorElementIDList (Error Component ID List) to avoid duplicate additions.

[0082] Spatial coding check Linked model determination: First, the model where the room is located must be determined. When filtering linked instances, if no linked model is found, a pop-up window will prompt "Room components are located in this model" and the current model will be used as the "room model". Otherwise, the linked file will be used as the "room model". The system handles elevation selection and room filtering. Rooms are strongly correlated with "levels," so users must first select a target level before filtering for rooms at that level. All levels in the model are filtered and stored in LevelList (level objects) and LevelNameList (level names). A floor plan selection interface pops up, allowing users to select either "current view level" or "multiple specified levels." The final filtered results are stored in LastLevelList. Room integrity verification: If the current model is a "non-linked model," it checks for "enclosed areas without created rooms" (e.g., walls enclosing areas without generated rooms) under a given level. If such areas exist, temporary rooms are automatically created and marked as "items to be deleted" for later post-filtering processing.

[0083] Instance library query condition construction: Construct an SQL query statement based on the filtered component ID and model file name. Read instance library data: Read component instance information from the database. If no data is read, a pop-up window will prompt "Component instance not entered into the database, it is recommended to enter into the database first".

[0084] Spatial coding full-dimensional inspection: (1) Spatial attribute integrity verification Batch read the key spatial attribute values ​​of the target components. These key spatial attributes include at least the floor, room type, and room number. Perform attribute existence and value integrity checks: if a component has missing attribute items or empty attribute values, perform the following operations: Generate a detailed attribute missing error message, recording the component's identifier and specific missing content; Add the missing attribute error message to the first error message set (used to categorize all attribute integrity errors); Add the component to the list of erroneous components and use a deduplication mechanism to prevent the same component from being recorded repeatedly; Update the attribute missing error counter to count the total number of such errors.

[0085] (2) Room category and number matching verification Perform format parsing and pairing validation on components with "room category" and "room number" attributes: Format parsing: If the attribute value of "Room Category" or "Room Number" is a multi-value string (e.g., "Office, Meeting Room" separated by commas), then a regular expression method is used to split it to obtain separate lists of room categories and room numbers.

[0086] Pairing Detection: Compare the number of room categories obtained after splitting with the number of room numbers. If the two numbers do not match, it is determined to be a pairing error, and a pairing mismatch error message is generated. This message is also added to the first error message set (belonging to attribute definition issues), and the corresponding component is marked as an erroneous component.

[0087] (3) Verification of the correctness of spatial coding logic Logical verification of the spatial encoding of the component itself is performed based on the standardized data source. Verification code generation: The system queries and retrieves the standard codes corresponding to the component attribute values ​​from a pre-defined specification database table (including floor code table, room category code table, and room number code table). Based on predefined coding rules, these standard codes are combined to generate a standard reference code.

[0088] Consistency check: Compare the component's own "spatial code" attribute value with the generated standard reference code: If the two are inconsistent, a coding verification error message is generated, added to the second error message set (used to classify all coding logic errors), and the coding verification error counter is updated.

[0089] If the process of generating standard reference codes fails because a certain attribute value of a component cannot be found in the corresponding specification database table, a specification table reference error message is generated, added to the third error message set (used to classify all errors that do not conform to the standard), and the specification table reference error counter is updated.

[0090] (4) Consistency check with database instance library The component information in the model is compared bidirectionally with the instance records in the business database to ensure data synchronization. Attribute matching: Compares the key spatial attributes of the component (floor, room category, room number) with the attribute values ​​of the corresponding records in the database instance. If inconsistencies are found, an instance database inconsistency error message is generated.

[0091] Encoding Matching: Compare the "spatial encoding" on the component with the corresponding "spatial encoding" stored in the database instance library. If the two do not match, or if the encoding in the instance library is empty, an instance library inconsistency error message is generated.

[0092] All instance library inconsistency error messages were added to the fourth error message set, and the instance library inconsistency error counter was updated.

[0093] (5) Structured display and export of inspection results All error messages generated during the above verification process are integrated and presented: Results integration: Error messages are organized into a structured manner according to categories (i.e., the first, second, third, and fourth error message sets), and the summary format is "Error Type - Error Quantity - Error Details List".

[0094] Results Display: If any errors are found, the system will automatically pop up a custom results display interface. Figure 8 The interface clearly displays the number and details of various errors (including the component's unique identifier and a detailed description of the error), and provides an interactive function to locate the erroneous component.

[0095] If all checks pass and no errors are found, a pop-up window will appear displaying "No problems were found in this full-dimensional spatial coding check" and showing the total time taken for this check.

[0096] The present invention also provides a Revit-based BIM model spatial encoding device, the device comprising: Initialization module: Configured to obtain all usable elevations from the building model, identify enclosed areas bounded by walls within the plane defined by the elevation, determine the upper limit elevation corresponding to the enclosed area; create several room objects based on the upper limit elevation and the enclosed area, and assign names and numbers to each room object; Attribute assignment module: When the current model is a non-building model, link its corresponding building model to the current model to obtain the room object information; when the current model is a building model, directly obtain the room object information. Assign spatial attributes to the building model, and assign space-coded related attributes to room objects, components within room objects, and components outside room objects but located in the building's functional space based on the spatial attributes. Encoding module: Configured to encode components within room objects and components outside room objects located within building functional spaces based on spatial encoding rules; Verification module: Configured to check room objects, and after passing the check, to perform multi-dimensional checks on the spatial codes of components; for components within room objects, multi-dimensional checks include attribute integrity, correct pairing of room category and room number, consistency of spatial code and coding rules, and consistency of component information with the component instance library records in the database; for components outside room objects but located within building functional spaces, checks include correct pairing of functional area category and functional area location number, consistency of spatial code and coding rules, and consistency of component information with the component instance library records in the database. For components that fail the inspection, errors are reported and their locations are identified. Modifications are made until all components pass the inspection. The spatial coding information of the verified components is synchronized to the downstream business system to guide construction positioning and operation and maintenance management.

[0097] The specific embodiments described above only illustrate the design principles of the present invention. The shapes and names of the components in this description may differ and are not limited. Therefore, those skilled in the art can modify or make equivalent substitutions to the technical solutions described in the foregoing embodiments; and such modifications and substitutions do not depart from the inventive spirit and technical solutions of the present invention, and should all fall within the protection scope of the present invention.

Claims

1. A spatial coding method for BIM models based on Revit, characterized in that, include: Step S1: Obtain all usable elevations from the building model, identify enclosed areas bounded by walls within the plane defined by the elevation, and determine the upper limit elevation corresponding to the enclosed area; create several room objects based on the upper limit elevation and the enclosed area, and assign names and numbers to each room object; Step S2: When the current model is not an architectural model, link its corresponding architectural model to the current model to obtain the room object information; when the current model is an architectural model, directly obtain the room object information. Assign spatial attributes to the building model, and assign space-coded related attributes to room objects, components within room objects, and components outside room objects but located in the building's functional space based on the spatial attributes. Step S3: Encode the components within the room object and the components outside the room object but located in the building's functional space based on spatial coding rules; Step S4: Inspect the room object. After the inspection is passed, perform a multi-dimensional inspection on the spatial code of the component. For components within the room object, the multi-dimensional inspection includes attribute integrity, correct pairing of room category and room number, consistency of spatial code and coding rules, and consistency of component information with the component instance library record in the database. For components outside the room object but located within the building's functional space, the multi-dimensional inspection includes consistency of spatial code and coding rules, correct pairing of functional area category and functional area location number, and consistency of component information with the component instance library record in the database. For components that fail the inspection, errors are reported and their locations are identified. Modifications are made until all components pass the inspection. The spatial coding information of the verified components is synchronized to the downstream business system to guide construction positioning and operation and maintenance management.

2. The method as described in claim 1, characterized in that, In step S2, spatial coding-related attributes are assigned to room objects, components within room objects, and components outside room objects but located within the building's functional space, based on spatial attributes of the building model. Spatial attributes include globally unique identifiers and spatial location; Based on spatial attributes, spatial coding-related attributes are assigned to room objects, components within room objects, and components outside room objects but located within the building's functional space in the building model. The spatial coding-related attributes of room objects include room name and number. The spatial coding-related attributes of components within room objects include the building to which the component belongs in the modeling model, the floor to which the component belongs, room category, and room number. The spatial coding-related attributes of components outside room objects but located within the building's functional space include the building to which the component belongs in the modeling model, the floor to which the component belongs, functional area category, and functional area location number.

3. The method as described in claim 1, characterized in that, The method further includes: when the building model changes, regenerating spatial codes for components within each room object and components outside each room object but located within the building's functional space, and performing multi-dimensional checks on the regenerated spatial codes; wherein, the changes include changes in the spatial location of the building model, changes in the attributes of each room object, and changes in the attributes related to the spatial codes of components within each room object; The step of regenerating spatial codes for components within each room object and components outside each room object but located within the building's functional space includes: encoding components based on the changed content and spatial coding rules, and updating the component instance library records in the database.

4. The method as described in claim 2, characterized in that, Step S3 involves encoding components within each room object and components outside each room object but located within the building's functional space based on spatial encoding rules, including: For components within a room object, the spatial coding rule is to determine code groups based on the attribute values ​​related to the spatial coding of the component. The code group includes the building code corresponding to the modeling model to which the component belongs, the floor code corresponding to the component, the room category code, and the room number code. The code groups are concatenated in sequence to form the spatial code. The spatial code from left to right is the building code corresponding to the modeling model, the floor code corresponding to the component, the room category code, and the room number code. For components located outside the room object but within the building's functional space, the spatial coding rule is to determine the code group based on the attribute values ​​related to the component's spatial coding. The code group includes the building code corresponding to the model to which the component belongs, the floor code corresponding to the component, the functional area category code, and the functional area location code. The code group is assembled in sequence to form the spatial code. The spatial code, from left to right, is the building code corresponding to the model, the floor code corresponding to the component, the functional area category code, and the functional area location code.

5. The method according to any one of claims 1-4, characterized in that, In step S4, the room objects are inspected, including: Check if there is a closed area below the target elevation that is enclosed by wall elements but has not been created as a room; When there is a closed area enclosed by wall elements but no room has been created, the room object will be checked and the closed area without a room will be identified and marked. Otherwise, if the room object passes the inspection, the room object is converted into a geometric entity, and components located inside the room object and components located outside the room object but within the building's functional space are selected.

6. The method as described in claim 5, characterized in that, In step S4, the method for checking the integrity of the attributes includes: Check if the spatial attribute values ​​of a component are empty. If the spatial attribute value of a component is empty, the check result is that the attribute is incomplete; if the attribute values ​​of all spatial attributes of a component are not empty, the check result is that the attribute is complete. In step S4, the method for checking the correctness of the pairing between room category and room number includes: When both the room category and room number of a component are multi-valued attributes, check whether each attribute value of the room category corresponds one-to-one with each attribute value of the room number; if not, the check result is a pairing error; if yes, the check result is a pairing correct. In step S4, the method for checking the consistency between the spatial encoding and the encoding rules includes: The integrity of the spatial encoding is checked. If the check passes, the spatial encoding is parsed to determine whether the parsing result is consistent with the encoding rule. If yes, the spatial encoding result is consistent with the encoding rule; otherwise, the spatial encoding result is inconsistent with the encoding rule.

7. A Revit-based BIM model spatial coding device, characterized in that, include: Initialization module: Configured to obtain all usable elevations from the building model, identify enclosed areas bounded by walls within the plane defined by the elevation, determine the upper limit elevation corresponding to the enclosed area; create several room objects based on the upper limit elevation and the enclosed area, and assign names and numbers to each room object; Attribute Assignment Module: When the current model is not a building model, link its corresponding building model to the current model to obtain the room object information; when the current model is a building model, directly obtain the room object information. Assign spatial attributes to the building model, and assign space-coded related attributes to room objects, components within room objects, and components outside room objects but located in the building's functional space based on the spatial attributes. Encoding module: Configured to encode components within room objects and components outside room objects located within building functional spaces based on spatial encoding rules; Verification module: Configured to check room objects, and after passing the check, to perform multi-dimensional checks on the spatial codes of components; for components within room objects, the multi-dimensional checks include attribute integrity, correct pairing of room category and room number, consistency of spatial code and coding rules, and consistency of component information with the component instance library records in the database; for components outside room objects but located within building functional spaces, the multi-dimensional checks include consistency of spatial code and coding rules, correct pairing of functional area category and functional area location number, and consistency of component information with the component instance library records in the database. For components that fail the inspection, errors are reported and their locations are identified. Modifications are made until all components pass the inspection. The spatial coding information of the verified components is synchronized to the downstream business system to guide construction positioning and operation and maintenance management.

8. A computer-readable storage medium, characterized in that, The storage medium stores a plurality of instructions; the plurality of instructions are loaded by a processor and executed as described in any one of claims 1-6.

9. An electronic device, characterized in that, The electronic device includes: A processor is used to execute multiple instructions; Memory, used to store multiple instructions; The plurality of instructions are to be stored in the memory and loaded by the processor and executed as described in any one of claims 1-6.