Methods and apparatus for classifying materials, machine-readable storage media and electronic devices
By combining AI large language models with material classification prompts and datasets, material types are automatically classified, solving the problem of low efficiency in manual classification in existing technologies. This achieves efficient and accurate material classification, supporting the seamless application of Revit files in subsequent production processes.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING GENERAL MUNICIPAL ENG DESIGN & RES INST
- Filing Date
- 2025-10-24
- Publication Date
- 2026-06-30
AI Technical Summary
In existing technologies, material classification mainly relies on manual methods, which leads to low efficiency and is prone to errors, and cannot meet the automation needs of Revit files in subsequent production processes.
By combining an AI large language model with datasets and material classification prompts, material types are automatically categorized. Multiple datasets are built by traversing model files, and the AI large language model is used to determine recommended material types, thus achieving automated material classification.
It enables automated material classification, reduces manual input, shortens the production cycle, improves accuracy, reduces human error, provides seamless material classification conditions, and supports subsequent production processes.
Smart Images

Figure CN121681904B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and more specifically, to a method and apparatus for classifying materials, a machine-readable storage medium, and an electronic device. Background Technology
[0002] Currently, material classification in Revit is mainly done manually, requiring manual judgment for each possible material.
[0003] Therefore, how to achieve automated classification of materials has become a technical problem that needs to be solved in this field. Summary of the Invention
[0004] In view of this, this application proposes a method and apparatus for classifying materials, a machine-readable storage medium and an electronic device to achieve automated classification of materials.
[0005] In a first aspect, embodiments of this application provide a method for classifying materials. This method includes: traversing model files and establishing a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. The first dataset includes identifiers for components with unspecified material geometric faces but no material parameters in their instance parameters. The second dataset includes identifiers for the type of each component in the first dataset. The third dataset includes identifiers for the type of components belonging to a system family in the first dataset. The fourth dataset includes identifiers for the type of components belonging to a loaded family in the first dataset. The fifth dataset includes identifiers for components with unspecified material geometric faces but no material parameters in their instance parameters. The sixth dataset includes identifiers of components with material parameters in their instance parameters and no unspecified geometric faces. The seventh dataset includes identifiers of materials whose material classification attributes do not conform to a preset specification. The mapping between identifiers of materials in the sixth dataset whose material classification attributes do not conform to the preset specification and identifiers of components using materials in the sixth dataset whose material classification attributes do not conform to the preset specification is also included. For each object in each of the third, fourth, fifth, and sixth datasets, a recommended material type is determined using an AI large language model, and the determined recommended material type is assigned to the object's material classification attribute.
[0006] Optionally, for any object in any of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined by combining the AI large language model, including: constructing classification prompt words that enable the AI large language model to analyze material types; constructing a request body including the classification prompt words and parameters required to call the AI large language model service; sending the request body to the API interface of the AI large language model; obtaining the analysis results of the AI large language model based on the request body; processing the analysis results and combining them with a preset material type list to determine the recommended material type.
[0007] Optionally, constructing classification prompts for the AI big data language model to analyze material types includes: when any object in any of the datasets is a type in the third dataset, the fourth dataset, or a component in the fifth dataset, obtaining the corresponding component core attributes, and constructing classification prompts for the AI big data language model to analyze material types based on the component core attributes and a preset material type list, wherein the component core attributes include: category name, family name, type name, and instance name; and / or when any object in any of the datasets is a material in the sixth dataset, constructing classification prompts for the AI big data language model to analyze material types based on the material name and usage environment.
[0008] Optionally, for any object in any of the third, fourth, fifth, and sixth datasets, the determined recommended material type is assigned to the object's material classification attribute, including: if any object in any of the datasets is a material in the sixth dataset, the determined recommended material type is assigned to the material's material classification attribute; if any object in any of the datasets is a type in the third or fourth dataset or a component in the fifth dataset, the following steps are performed: determining an empty material classification attribute; determining whether the material classification attribute is a read-only parameter; if the material classification attribute is not a read-only parameter, the following steps are performed: verification. Whether the material classification attribute can be written; if the material classification attribute can be written, based on the determined recommended material type and the preset standard material library, determine the identifier corresponding to the determined recommended material type, and assign the determined identifier to the material classification attribute; if the material classification attribute is a read-only parameter, the object is of the type in the third dataset, obtain the composite structure corresponding to the object, traverse the composite structure to determine the layer corresponding to the empty material classification attribute, determine the identifier corresponding to the determined recommended material type based on the determined recommended material type and the preset standard material library, and assign the determined identifier to the material classification attribute of the determined layer.
[0009] Optionally, a preset standard material library is created, including: for each material type in the preset material type list, the following is performed: determine whether there is a material type with the same name in the Revit project; if there is, store the correspondence between the material type and the identity identifier corresponding to the material type in a preset dictionary structure; if there is no material type, create a new material type and store the correspondence between the new material type and the identity identifier corresponding to the material type in the preset dictionary structure.
[0010] Optionally, the model file is traversed to create a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset, including: for each component in the model file, the following steps are performed: traversing the geometric faces of the component, determining whether the component has geometric faces with unspecified materials; if the component has geometric faces with unspecified materials, then the following steps are performed: storing the component's identifier in the first dataset; storing the component's type identifier in the second dataset; determining whether the component's family is a system family or a loaded family, and if the component's family is a system family, then storing the component's type identifier. The identifier of the component is stored in the third dataset. If the family of the component is a loaded family, the identifier of the component type is stored in the fourth dataset. It is determined whether there is a material parameter in the instance parameters of the component. If there is a material parameter in the instance parameters of the component, the identifier of the component is moved from the first dataset to the fifth dataset. If the component does not have geometric patches without specified material but has materials whose material classification attributes do not conform to the preset specification, the identifier of the materials whose material classification attributes do not conform to the preset specification is stored in the sixth dataset, and the correspondence between the materials whose material classification attributes do not conform to the preset specification and the component is stored in the seventh dataset.
[0011] Secondly, embodiments of this application also provide a material classification device, which includes: a creation module for traversing model files and creating a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. The first dataset includes identifiers of components that have geometric faces with unspecified materials but whose instance parameters do not contain material parameters. The second dataset includes identifiers of the type of each component in the first dataset. The third dataset includes identifiers of the type of components belonging to the system family in the first dataset. The fourth dataset includes identifiers of the type of components belonging to the loaded family in the first dataset. The fifth dataset includes identifiers of components that have geometric faces with unspecified materials. The third dataset includes the identifiers of components with geometric faces and material parameters in their instance parameters. The sixth dataset includes the identifiers of materials whose material classification attributes do not conform to the preset specifications for components without geometric faces that do not have unspecified materials. The seventh dataset includes the correspondence between the identifiers of materials whose material classification attributes do not conform to the preset specifications in the sixth dataset and the identifiers of components using materials whose material classification attributes do not conform to the preset specifications in the sixth dataset. The determination module is used to determine the corresponding recommended material type for each object in each of the third, fourth, fifth, and sixth datasets, in conjunction with the AI large language model, and assign the determined recommended material type to the material classification attribute of the object.
[0012] Optionally, for any object in any of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined by combining the AI large language model, including: constructing classification prompt words that enable the AI large language model to analyze material types; constructing a request body including the classification prompt words and parameters required to call the AI large language model service; sending the request body to the API interface of the AI large language model; obtaining the analysis results of the AI large language model based on the request body; processing the analysis results and combining them with a preset material type list to determine the recommended material type.
[0013] Optionally, constructing classification prompts for the AI big data language model to analyze material types includes: when any object in any of the datasets is a type in the third dataset, the fourth dataset, or a component in the fifth dataset, obtaining the corresponding component core attributes, and constructing classification prompts for the AI big data language model to analyze material types based on the component core attributes and a preset material type list, wherein the component core attributes include: category name, family name, type name, and instance name; and / or when any object in any of the datasets is a material in the sixth dataset, constructing classification prompts for the AI big data language model to analyze material types based on the material name and usage environment.
[0014] Optionally, the determining module assigns the determined recommended material type to the material classification attribute of any object in any of the third dataset, the fourth dataset, the fifth dataset, and the sixth dataset, including: if any object in any of the datasets is a material in the sixth dataset, assigning the determined recommended material type to the material classification attribute; if any object in any of the datasets is a type in the third or fourth dataset or a component in the fifth dataset, performing the following: determining an empty material classification attribute; determining whether the material classification attribute is a read-only parameter; if the material classification attribute is not a read-only parameter, performing the following: The process involves: verifying whether the material classification attribute can be written; if the material classification attribute can be written, determining the identifier corresponding to the determined recommended material type based on the determined recommended material type and the preset standard material library, and assigning the determined identifier to the material classification attribute; if the material classification attribute is a read-only parameter, and the object is of the type in the third dataset, obtaining the composite structure corresponding to the object, traversing the composite structure to determine the layer corresponding to the empty material classification attribute, determining the identifier corresponding to the determined recommended material type based on the determined recommended material type and the preset standard material library, and assigning the determined identifier to the material classification attribute of the determined layer.
[0015] Optionally, a preset standard material library is created, including: for each material type in the preset material type list, the following is performed: determine whether there is a material type with the same name in the Revit project; if there is, store the correspondence between the material type and the identity identifier corresponding to the material type in a preset dictionary structure; if there is no material type, create a new material type and store the correspondence between the new material type and the identity identifier corresponding to the material type in the preset dictionary structure.
[0016] Optionally, the creation module traverses the model file to create a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset, including: for each component in the model file, performing the following: traversing the geometric faces of the component, determining whether the component has geometric faces with unspecified materials; if the component has geometric faces with unspecified materials, then performing the following: storing the component's identifier in the first dataset; storing the component's type identifier in the second dataset; determining whether the component's family is a system family or a loaded family, and if the component's family is a system family, then storing the component's type identifier in the second dataset. The identifier of the component is stored in the third dataset. If the family of the component is a loaded family, the identifier of the component type is stored in the fourth dataset. It is determined whether there is a material parameter in the instance parameters of the component. If there is a material parameter in the instance parameters of the component, the identifier of the component is moved from the first dataset to the fifth dataset. If the component does not have geometric patches without specified materials but has materials whose material classification attributes do not conform to the preset specifications, the identifier of the materials whose material classification attributes do not conform to the preset specifications is stored in the sixth dataset, and the correspondence between the materials whose material classification attributes do not conform to the preset specifications and the component is stored in the seventh dataset.
[0017] Thirdly, embodiments of this application also provide a machine-readable storage medium storing instructions that cause a machine to perform the above-described classification method.
[0018] Fourthly, embodiments of this application also provide an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the executable instructions to implement the above-described classification method.
[0019] According to the technical solution of this application, the model files are traversed to establish a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. For each object in each of the third dataset, the fourth dataset, the fifth dataset, and the sixth dataset, the corresponding recommended material type is determined by combining the AI large language model, and the determined recommended material type is assigned to the material classification attribute of the object. In this way, the material type is determined, and the material classification is realized. In addition, no manual intervention is required in the process of material classification, thus realizing automated material classification.
[0020] Other features and advantages of this application will be described in detail in the following detailed description section. Attached Figure Description
[0021] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application, and the illustrative embodiments and descriptions thereof are used to explain this application. In the drawings:
[0022] Figure 1 A flowchart illustrating a material classification method according to a preferred embodiment of this application;
[0023] Figure 2 This is a logical diagram illustrating the determination of recommended material types according to a preferred embodiment of this application;
[0024] Figure 3 Screenshot of a Revit program form (online billing model - API interface) according to a preferred embodiment of this application;
[0025] Figure 4 A screenshot of a Revit program form (local deployment model - API interface) according to a preferred embodiment of this application;
[0026] Figure 5 This is a structural block diagram of a material classification device according to a preferred embodiment of this application. Detailed Implementation
[0027] The technical solution of this application will now be described in detail with reference to the accompanying drawings and embodiments.
[0028] Materials are difficult to categorize automatically, which hinders Revit files from serving as a basis for subsequent production processes and makes it impossible to effectively deliver materials at this stage. To enable effective material categorization within Revit files, providing usable and efficient queries, and offering seamless material categorization conditions for subsequent production processes, we can: for example, create corresponding material spheres for categorized materials in advance during the visualization phase of the project, and attach the appropriate material spheres before importing components into the visualization environment; or, categorize materials accordingly, achieving unified management based on Revit's material and material categorization systems, thus enabling procedural conditions for subsequent material statistics and allocation.
[0029] Previously, classifying materials in Revit files typically required extensive manual searching and modification of materials after the Revit RVT files were created. This process was not procedural because a large number of unclassifiable conditions made it impossible to implement an effective procedure, thus inevitably requiring a significant investment of manpower and a long work cycle.
[0030] The technical solution provided in this application aims to minimize manual input by fully automating the process. This reduces both the cost and time of manual labor, and while reducing manpower, it also improves the accuracy of assessments to avoid unavoidable human errors. However, it should be emphasized that even with AI-powered large language models, errors cannot be completely eliminated. Nevertheless, it can effectively prevent the output of substandard materials, and by providing a fault-tolerance mechanism, it can categorize unidentifiable items, reducing the number of elements with unidentifiable materials. In summary, the purpose of the technical solution provided in this application is to reduce manual input, shorten the construction period, achieve automation, and efficiently and accurately classify materials within Revit files, thus facilitating delivery and subsequent use.
[0031] Currently, material classification is primarily done manually, requiring manual judgment for each possible material. Therefore, in model production, material classification typically involves two methods: pre-defined material types and characteristics for use in the loaded family's family symbol. Elements with automatically bound materials are then automatically generated by the family. These generated elements can then be classified using appropriate programs. While system families don't adhere to the loaded family symbol's characteristics, they still generate corresponding elements with family-related materials according to Revit's specifications. However, this approach is often ideal and difficult to implement in practice. Therefore, manual judgment is usually required for post-binding material management, including classification. Revit, as a commonly used architectural BIM design tool, enjoys widespread market application. However, its relatively open workflow makes pre-binding difficult, especially since file editing is quite open. This leads to numerous work states that cannot be pre-bound during file transfer and editing, requiring subsequent manual sorting and categorization, particularly of materials. In other words, material binding and categorization inevitably require post-delivery human intervention. This presents significant practical challenges for subsequent visualization and material statistics.
[0032] The technical solution provided in this application addresses the characteristics of post-binding by offering a method for fully automated material classification using an AI-powered large language model. The intervention of this AI model enables unified semantic expression and classification of ambiguity, polysemy, and multilingual issues within its semantic framework. Furthermore, this material classification allows the classification and its components to be passed to the next stage, such as visualization and material classification, enabling corresponding usage and further development capabilities.
[0033] Firstly, this application provides a method for classifying materials. In this application, the automatic classification of materials is achieved based on a large language model of Artificial Intelligence (AI).
[0034] Figure 1 This is a flowchart illustrating a material classification method according to a preferred embodiment of this application. For example... Figure 1 As shown, this classification method includes the following:
[0035] In step S10, the model file is traversed to establish a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. The first dataset includes identifiers of components that have geometric faces with no specified material but whose instance parameters do not contain material parameters. The second dataset includes identifiers of the type of each component in the first dataset. The third dataset includes identifiers of the type of components belonging to the system family in the first dataset. The fourth dataset includes identifiers of the type of components belonging to the loaded family in the first dataset. The fifth dataset includes identifiers of components that have geometric faces with no specified material but whose instance parameters contain material parameters. The sixth dataset includes identifiers of materials whose material classification does not conform to the preset specification for components without geometric faces with no specified material. The seventh dataset includes the correspondence between identifiers of components without geometric faces with no specified material and identifiers of materials whose material classification does not conform to the preset specification.
[0036] In this embodiment, the process of traversing the model file to establish the aforementioned seven datasets constitutes the data acquisition process. Data acquisition is the core foundation of this method, and it can be implemented through the IExportContext interface provided by the Revit API. In this embodiment, all components in the specified model file can be deeply traversed, and various material-related information can be accurately collected during this process, ultimately forming a structured dataset for AI large language model judgment and subsequent repair. Furthermore, this process can be driven by the CustomExporter class, with specific logic implemented by a custom JsExportContext class. Additionally, in this embodiment, the model file needs to be traversed in a 3D view. First, it is determined whether the current view is a 3D view; if not, an error dialog box can pop up, prompting "Output must be performed in a 3D view."
[0037] During the process of traversing the model, the following seven core datasets are dynamically created.
[0038] The first dataset (InvalidElementList) stores the identifiers of all traversed components whose own geometric faces have no specified material; that is, the set of ElementIds for these components. These components are the direct carriers of the material problem. Furthermore, for components in the first dataset, there are no material parameters in the instance parameters.
[0039] The second dataset (InvalidTypeIdSet) stores the identity identifiers of all components in the first dataset, i.e., the collection of type ElementId(GetTypeId()); by operating on the type, all instances of the same type can be repaired in batches.
[0040] The third dataset (InvalidTypeC), a subset of the second dataset, is specifically used to store the identity identifiers of system families (such as walls, floors, roofs, etc.), that is, a collection of type ElementIds.
[0041] The fourth dataset (InvalidTypeD), a subset of the second dataset, is specifically used to store the identity identifiers of the loaded families (such as doors, windows, regular models, etc.), that is, the collection of type ElementId (i.e. FamilySymbol).
[0042] The fifth dataset (InvalidInstanceMaterialList) stores the identifiers (ElementIds) of components that, although they have geometric faces without bound materials, possess a material parameter named "Material" in their instance parameters. This represents the problem of missing materials at the instance level.
[0043] The sixth dataset (InvalidMaterialSet) stores the identifiers of materials that have been used in the model but whose material classification attributes (MaterialClass) do not conform to the preset specifications; that is, the set of ElementIds for these materials. In this embodiment, a material classification attribute not conforming to the preset specifications can mean that the material classification attribute is empty or that the material type represented by the material classification attribute is not in the preset material type list.
[0044] The seventh dataset (MaterialUsageMap) is a dictionary structure that records which components use each material object. It includes the mapping between the material identifiers from the sixth dataset and the identifiers of the components using those materials. In the seventh dataset, the key is the material's ElementId, and the value is a list of component ElementIds using that material. The seventh dataset provides crucial contextual information for repairing the materials in the sixth dataset.
[0045] The population of the aforementioned datasets is primarily completed within the `OnMaterial(MaterialNode node)` callback function of `IExportContext`. This function is called when a geometric facet of a component is encountered. Specifically, if `node.MaterialId` is valid, the `MaterialClass` property of the material is checked, i.e., the material classification property. If the material classification property does not conform to the preset specifications (not in the preset material type list or the material classification property is empty), the material's ID (i.e., identifier) is added to the sixth dataset, and the mapping relationship of set G is updated. If `node.MaterialId` is `InvalidElementId`, indicating that the current geometric facet has no material (i.e., it is not bound or has not been assigned a material), the program will obtain the component currently being processed and, based on its characteristics such as whether it is a system family or a loaded family, and whether it has instance material parameters, populate its ID or its type ID into the first, second, third, fourth, and fifth datasets respectively.
[0046] In step S11, for each object in each of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined by combining the AI large language model, and the determined recommended material type is assigned to the object's material classification attribute.
[0047] After obtaining the recommended material types from the AI large language model, the final step is to perform the actual modifications in the Revit model. All modifications can be performed within a dedicated module called MaterialFixUtility, and can be wrapped in a single Revit transaction. This guarantees the atomicity of all operations—either all succeed or can be completely undone in case of failure, ensuring the safety of the model data.
[0048] Optionally, in this embodiment, at the start of traversing the model file, a list of preset material types can be obtained, and all preset material types can be loaded into memory for later use.
[0049] Optionally, in this embodiment of the application, for any object in any of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined by combining an AI large language model, including the following: [Combined with...] Figure 2 An example is provided.
[0050] In step S20, classification prompts are constructed to enable the AI large language model to analyze material types.
[0051] Optionally, in this embodiment of the application, constructing classification prompts that enable the AI large language model to analyze material types may include the following:
[0052] If any object in any of the datasets is a type in the third or fourth dataset or a component in the fifth dataset, obtain the corresponding component core attributes. Based on the component core attributes and the preset material type list, construct classification prompts that enable the AI large language model to analyze the material type. The component core attributes include: category name, family name, type name, and material classification attribute.
[0053] After data collection is complete, the program enters the intelligent classification stage. This stage is handled by a dedicated AIClassificationService class, which encapsulates all the interaction logic with the AI large language model's API.
[0054] The core of this application lies in constructing highly optimized classification prompts for different scenarios to guide the AI large language model to make the most accurate judgments.
[0055] For component classification hints: When it is necessary to determine what material to assign to a component without material (from the third, fourth, and fifth datasets), the program will construct classification hints with the following structure. These hints clearly define the expert role and task objective for the AI large language model, provide key attributes of the component as the basis for judgment, and strictly limit the output format.
[0056] The specific content of the category suggestion keywords is as follows:
[0057] You are a professional architectural design expert. Based on the following Revit component properties, please determine the composition of this component. The most important types of materials.
[0058] Please select only the most suitable material type from the following list as the output. The output must be its... The exact name of a category item; do not output the explanation.
[0059]
Component Properties
[0060] Category: {0}
[0061] Family: {1}
[0062] Type (Symbol): {2}
[0063] Instance name (Instance): {3}
[0064] [Optional Categories]
[0065] {4}
[0066] Please output only the most suitable category name.
[0067] The four core parameters here come from the component: Category.Name, Family.Name, Symbol.Name, and most importantly, the name of the parameter that causes the material to be missing (e.g., "Main Material," "Facepiece Material," etc.). The final {4} section will fill in all the material types in the preset material type list, forming a closed-set multiple-choice question.
[0068] And / or, if either of the objects is a material in the sixth dataset, construct classification prompts based on the material name and usage environment to enable the AI large language model to analyze the material type.
[0069] For material name classification hints: When repairing a material object that has not been correctly classified (materials from dataset 6), the program uses a more concise hint, relying solely on the material's name (e.g., "concrete-C30-pumping"). Specifically, classification hints are constructed based on the material name and its usage environment. The usage environment refers to the characteristics of the components using that material, which can be determined by combining the contextual information of the components in dataset 7. By analyzing the contextual information of the components in dataset 7, the general characteristics of the components using the material can be analyzed, thus determining the material's usage environment.
[0070] In step S21, a request body is constructed that includes classification prompts and parameters required to invoke the AI large language model service.
[0071] Specifically, in this embodiment, the parameters required to call the AI large language model service can be stored in a file, and the classification prompts and the file can be packaged together into a request body. For example, the request body can be packaged into JSON format using AIClassificationService and sent to the API interface of the AI large language model via an HTTP POST request.
[0072] In step S22, the request body is sent to the API interface of the AI large language model.
[0073] In step S23, the analysis results of the AI large language model based on the request body are obtained.
[0074] In step S24, the analysis results are processed, and the recommended material types are determined by combining them with the preset material type list.
[0075] Specifically, upon receiving the analysis results (e.g., in JSON format) from the AI language model, the program performs robust parsing. It first removes any unnecessary thought processes or explanatory text that the AI language model might have generated. Then, it precisely matches the returned content against an item from the preset material category list, ensuring that the final result is a clean and valid category name, and that the recommended material category exists within the preset list. Specifically, it parses the returned analysis results, extracts the text content output by the AI language model, and cleans the text, removing irrelevant characters and explanations. The cleaned text is then matched against the preset material category list, and the material categories that match are used as recommended material categories. If no match is found, a default value (e.g., "Unknown category") is returned to prevent program errors.
[0076] The total number of tokens consumed during the entire process of calling the AI large language model (Prompt Tokens, Completion Tokens, Total Tokens) will be accurately counted and output to the log at the end for cost accounting.
[0077] Optionally, in the embodiments of this application, assigning the determined recommended material type to the material classification attribute of any object in any of the third dataset, fourth dataset, fifth dataset, and sixth dataset may include the following:
[0078] If any object in either dataset is a material in the sixth dataset, the determined recommended material type is assigned to the material classification attribute.
[0079] The materials in the sixth dataset are unclassified. The program iterates through each material to be repaired in the sixth dataset (InvalidMaterialSet). Using the context provided by the seventh dataset (MaterialUsageMap), the program analyzes the common characteristics of components using this material and calls the AI large language model service to determine the recommended material type. After obtaining the correct classification returned by the AI large language model, the program directly modifies the MaterialClass attribute of the material object to complete the classification.
[0080] If any object in either dataset is of a type in the third or fourth dataset, or a component in the fifth dataset, perform the following.
[0081] Identify material category attributes that are empty. Determine if the material category attribute is a read-only parameter.
[0082] If the material classification attribute is not a read-only parameter, perform the following: Verify that the material classification attribute can be written. If the material classification attribute can be written, based on the determined recommended material type and the preset standard material library, determine the identifier corresponding to the determined recommended material type, and assign the determined identifier to the material classification attribute.
[0083] Optionally, in this embodiment, write verification can be performed based on the following: If the material classification attribute parameter is writable, the program will not immediately write the recommended material type suggested by the AI large language model. Instead, it will first attempt to write a temporary, different material type, and then immediately read back the value of the material classification attribute to check if the write was successful. After a successful test, the program will restore the original state. This "pre-write" test (i.e., write verification) can effectively identify parameters that are "pseudo-writable" (writable at the API level, but actually controlled by Revit's internal logic and cannot be modified), greatly improving the success rate and stability of the repair. If the test fails, the object (type or component) will be recorded and skipped to avoid unnecessary errors.
[0084] For material category attributes that pass the write verification, binding is performed. The program will find the material ID corresponding to the recommended material type determined by the AI large language model from the preset standard material library, which is the material's identity identifier, and set it to the material category attribute to complete the binding.
[0085] When the material classification attribute is a read-only parameter, the object is of type in the third dataset. The composite structure corresponding to the object is obtained. The composite structure is traversed to determine the layer corresponding to the empty material classification attribute. Based on the determined recommended material type and the preset standard material library, the identity identifier corresponding to the determined recommended material type is determined, and the determined identity identifier is assigned to the material classification attribute of the determined layer.
[0086] If the material classification attribute is a read-only parameter, then the object represents the type attribute of a system family such as a wall or floor slab. The program will attempt to obtain its compound structure. Then, it will traverse each layer in the compound structure, find the layer with invalid material (i.e., the layer with an empty material classification attribute), and replace its material ID with the material ID corresponding to the recommended material type recommended by the AI large language model, thereby repairing the material of the system family structure.
[0087] In this implementation, the third, fourth, and fifth datasets are repaired, specifically objects with invalid materials (i.e., no material specified). This is the largest-scale repair step, uniformly processing all elements (including component instances and component types) from the three datasets. The program iterates through all parameters of each object, searching for parameters that should be materials but are currently empty or invalid—that is, finding empty material classification attributes. Once the target parameter is found, the AI large language model is invoked to perform a classification service, passing in the object's category, family, type, and instance name to obtain the material classification recommended by the AI large language model.
[0088] In this implementation, transaction commit and log summary can also be performed. Once all repair operations are complete, the transaction is finally committed, and all changes are permanently applied to the model file. The program will output a final summary report in the log window, including a list of all successfully repaired items, a list of items skipped due to write failures or other reasons, and the total token consumption for this operation, providing users with a complete record of operations and feedback.
[0089] Optionally, in this embodiment of the application, creating a preset standard material library may include the following:
[0090] For each material type in the list of preset material types, perform the following: Determine if the same material type exists in a Revit project. Here, a Revit project refers to an architectural project designed using Revit.
[0091] If it exists, the correspondence between material types and their corresponding identifiers will be stored in a preset dictionary structure.
[0092] If a material type does not exist, a new material type is created, and the correspondence between the new material type and its corresponding identifier is stored in a preset dictionary structure. This preset dictionary structure is the preset standard material library. In other words, a new material is created, and the material type is assigned the material classification attribute to the new material.
[0093] In this implementation, the program first obtains a list of preset material types. For each material type, it checks if a material with the same name already exists in the Revit project. If not, it automatically creates a new material and assigns the material type attribute to the new material. Then, it stores the mapping between created or found materials and their identifiers in a dictionary (createdOrFound) for quick retrieval in subsequent binding steps. This step ensures that every classification result that the AI large language model might return has a corresponding, usable material entity in Revit.
[0094] Optionally, in this embodiment of the application, traversing the model file and establishing a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset may include the following: Specifically, for each component in the model file, the following steps are performed.
[0095] Iterate through the geometric faces of the component and determine if there are any geometric faces without a specified material. That is, for each geometric face, check if node.MaterialId == InvalidElementId. If so, the material is invalid; otherwise, a specific material is specified.
[0096] If a component has geometric faces without a specified material, perform the following steps: Store the component's identifier in the first dataset. Store the component's type identifier in the second dataset. Determine whether the component's family is a system family or a loaded family. If the component's family is a system family, store the component's type identifier in the third dataset; if the component's family is a loaded family, store the component's type identifier in the fourth dataset. Determine whether the component's instance parameters contain a material parameter. If the component's instance parameters contain a material parameter, move the component's identifier from the first dataset to the fifth dataset.
[0097] If a component does not have any geometric faces without a specified material but has materials whose material classification attributes do not conform to the preset specifications, then it is determined whether the material classification attributes conform to the preset specifications. If the material classification attributes do not conform to the preset specifications, the identifier of the material whose material classification attributes do not conform to the preset specifications is stored in the sixth dataset, and the correspondence between the material whose material classification attributes do not conform to the preset specifications and the component is stored in the seventh dataset. Additionally, it can also record "This material is used by the current component".
[0098] Optionally, in embodiments of this application, the classification method may further include the following: reading a material type preset file to obtain a preset material type list; and / or reading an API interface parameter preset file to obtain the parameters required to call the AI large language model service.
[0099] Optionally, in the embodiments of this application, a material type preset file and / or an API interface parameter preset file can be preset.
[0100] In this embodiment, data preparation and environment initialization can be performed first. Before starting this method, necessary configuration and preparation work needs to be done to ensure the correctness of the program's operating environment. This stage mainly includes the following:
[0101] Prepare the necessary configuration files. Call the AI Large Language Model API interface parameter preset file (model_config.json). This can be a JSON format configuration file used to store all the parameters required to call the AI Large Language Model service. Its core fields include: ModelName (user-defined model name, used for interface display), ApiEndpoint (API access point URL address for the large language model service), ApiKey (API key string used for authentication), ModelID (specific identifier of the large language model used), Temperature (temperature parameter, used to control the creativity of the model output; lower values (e.g., 0.1-0.2) make the output more stable and deterministic), and MaxTokens (maximum number of tokens returned in a single request, used to control the length of the response content).
[0102] The material category preset file (categories.json) can be in JSON format and contains an array named Categories, which presets all legal and standard material category names for this project. These names will serve as the sole target options for AI large language model classification, ensuring the standardization and consistency of classification results. For example: ["concrete", "metal", "wood", "glass", ...].
[0103] Plugin deployment and startup. Place the assembly DLL file, Revit plugin manifest file (.addin), and the two JSON configuration files mentioned above, along with the implementation details described in this application, in the loading directory specified for the Revit plugin.
[0104] Users initiate this feature in Revit (e.g., by clicking the plug-in button). The program first checks the runtime environment, requiring execution in 3D view, as the 3D view contains the most comprehensive component geometry and material information, providing the best context for performing the export.
[0105] User interface initialization. Upon startup, the program will pop up a user interaction window (ExportStatusForm) via a separate thread. This window automatically loads and displays the current configurations in model_config.json and categories.json, allowing users to temporarily review or modify AI model parameters or material type lists before running. This window also features real-time log display; in subsequent processing, all key steps, AI judgment results, success or failure information will be output to this window in real time, providing users with completely transparent process monitoring.
[0106] In summary, the embodiments of this application aim to provide a method for automating the classification and repair of model component materials in Revit software using an artificial intelligence (AI) large language model, i.e., achieving automated material classification. The implementation of this method includes the following core steps: data preparation and environment initialization, intelligent acquisition of component and material data based on IExportContext, AI large language model invocation and intelligent material classification, and automated material repair and binding based on Revit transactions. Through the close collaboration of these four parts, this application constructs a closed-loop automated process from data acquisition and intelligent analysis to final execution, which can accurately and efficiently solve the complex material classification and repair problems in Revit projects. This method addresses the pain points of existing technologies where the diversity and complexity of Revit element and material management leads to difficulties in programmatic implementation and reliance on manual judgment. It introduces the powerful semantic understanding and reasoning capabilities of a large language model to establish a fully automated, efficient, and highly accurate material processing workflow. This process not only resolves ambiguity, polysemy, and multilingual issues in material naming, but also handles the binding of complex system families, loaded families, and instance-level materials in Revit through rigorous program logic. Ultimately, it provides a standardized and unified data foundation for subsequent stages such as project delivery, visualization rendering, and material statistics, solving the problem of diverse and complex element expressions caused by the multi-level structure of system families and loaded families. The technical solution provided in this application enables the programmatic and automated modification of the material classification of all components in Revit files. In this application's implementation, the material binding method is unified and no longer relies on custom variable names. Furthermore, the technical solution provided in this application's implementation gives materials definite classification attributes, avoiding multiple ambiguous expressions of the same material with different management characteristics. In addition, by combining with an AI large language model, materials can form a unified semantic expression and classification within the semantic system of the AI large language model, avoiding the problem of multiple expressions for the same material and reducing the difficulty of material classification and translation between multiple languages.
[0107] The technical solutions provided in this application can be applied to disciplines such as municipal infrastructure design, architectural design, artificial intelligence (AI), BIM (Building Information Modeling) technology, and geographic information systems (GIS), covering majors such as electronic computers, civil engineering, architecture, and water conservancy.
[0108] Verification has shown that the technical solution provided in this application can achieve fully automated modification of material values and material binding after preparation is complete. The original operation, which resulted in 20 material errors and 100 material binding errors, took approximately two hours. Using this patented method, it takes approximately two minutes, with the waiting time primarily due to AI server access, resulting in an efficiency improvement of over 60 times, and with perfect accuracy. (See attached...) Figure 3 As can be seen, the processing of the above file sent 47,000 tokens and returned 218 tokens. For the current pricing model, which costs 0.3 yuan per million tokens sent and 0.6 yuan per million tokens received, the above cost is approximately 1.4 cents (Doubao's lightest non-thinking text model). This method can also determine the material by accessing the locally deployed model; see appendix. Figure 4 A large model with around 7 billion (7b) parameters deployed locally can meet the final judgment requirements, but loading the model locally is slow and requires preloading the model.
[0109] Secondly, embodiments of this application also provide a material classification device.
[0110] Figure 5 This is a structural block diagram of a material classification device according to a preferred embodiment of this application. Figure 5 As shown, the classification device includes a creation module 10 and a determination module 20.
[0111] Module 10 is used to traverse the model files and create the first, second, third, fourth, fifth, sixth, and seventh datasets. The first dataset includes identifiers for components with unspecified material geometric faces but no material parameters in their instance parameters. The second dataset includes identifiers for the type of each component in the first dataset. The third dataset includes identifiers for the type of components belonging to the system family in the first dataset. The fourth dataset includes identifiers for the type of components belonging to the loaded family in the first dataset. The fifth dataset includes identifiers for components with unspecified material geometric faces but material parameters in their instance parameters. The sixth dataset includes identifiers for materials whose material classification attributes do not conform to the preset specifications for components without unspecified material geometric faces. The seventh dataset includes the correspondence between the identifiers of materials whose material classification attributes do not conform to the preset specifications in the sixth dataset and the identifiers of components using materials whose material classification attributes do not conform to the preset specifications in the sixth dataset. Module 20 is used to determine the corresponding recommended material type for each object in each of the third, fourth, fifth, and sixth datasets, using the AI large language model, and assign the determined recommended material type to the object's material classification attribute.
[0112] Optionally, for any object in any of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined by combining the AI big language model, including: constructing classification prompts that enable the AI big language model to analyze material types; constructing a request body that includes the classification prompts and parameters required to call the AI big language model service; sending the request body to the API interface of the AI big language model; obtaining the analysis results of the AI big language model based on the request body; processing the analysis results and combining them with a preset list of material types to determine the recommended material type.
[0113] Optionally, constructing classification prompts for the AI large language model to analyze material types includes: when any object in either dataset is a type in the third or fourth dataset or a component in the fifth dataset, obtaining the corresponding component core attributes, and constructing classification prompts for the AI large language model to analyze material types based on the component core attributes and a preset list of material types, wherein the component core attributes include: category name, family name, type name, and instance name; and / or when any object in either dataset is a material in the sixth dataset, constructing classification prompts for the AI large language model to analyze material types based on the material name and usage environment.
[0114] Optionally, the determination module assigns the determined recommended material type to the material classification attribute of any object in any of the third, fourth, fifth, and sixth datasets. This includes: if any object in any of the datasets is a material in the sixth dataset, assigning the determined recommended material type to the material classification attribute; if any object in any of the datasets is a type in the third or fourth dataset or a component in the fifth dataset, performing the following: determining an empty material classification attribute; determining whether the material classification attribute is a read-only parameter; if the material classification attribute is not a read-only parameter, performing the following: verifying the material classification attribute. Whether the class attribute can be written; if the material classification attribute can be written, based on the determined recommended material type and the preset standard material library, determine the identifier corresponding to the determined recommended material type, and assign the determined identifier to the material classification attribute; if the material classification attribute is a read-only parameter, the object is of the type in the third dataset, obtain the composite structure corresponding to the object, traverse the composite structure to determine the layer corresponding to the empty material classification attribute, determine the identifier corresponding to the determined recommended material type based on the determined recommended material type and the preset standard material library, and assign the determined identifier to the material classification attribute of the determined layer.
[0115] Optionally, a preset standard material library is created, including: for each material type in the preset material type list, the following is performed: determine whether there is a material type with the same name in the Revit project; if there is, store the correspondence between the material type and the identity identifier corresponding to the material type in the preset dictionary structure; if there is no material type, create a new material type and store the correspondence between the new material type and the identity identifier corresponding to the material type in the preset dictionary structure.
[0116] Optionally, a module is established to traverse the model file and create a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. This includes: for each component in the model file, performing the following: traversing the component's geometric faces and determining if the component has any geometric faces without a specified material; if the component has geometric faces without a specified material, then performing the following: storing the component's identifier in the first dataset; storing the component's type identifier in the second dataset; determining whether the component's family is a system family or a loaded family; if the component's family is a system family, storing the component's type identifier in the third dataset; if the component's family is a loaded family, storing the component's type identifier in the fourth dataset; determining whether the component's instance parameters contain material parameters; if the component's instance parameters contain material parameters, moving the component's identifier from the first dataset to the fifth dataset; if the component does not have any geometric faces without a specified material but has materials whose material classification attributes do not conform to the preset specifications, then storing the identifiers of the materials whose material classification attributes do not conform to the preset specifications in the sixth dataset, and storing the correspondence between the materials whose material classification attributes do not conform to the preset specifications and the components in the seventh dataset.
[0117] The working principle and benefits of the material classification device provided in this application are similar to those of the material classification method provided in this application, and will not be repeated here.
[0118] Thirdly, embodiments of this application also provide a machine-readable storage medium storing instructions that cause a machine to perform the above-described classification method.
[0119] Fourthly, embodiments of this application also provide an electronic device, the electronic device comprising: a processor; a memory for storing executable instructions of the processor; the processor being configured to read the executable instructions from the memory and execute the executable instructions to implement the above-described classification method.
[0120] The preferred embodiments of this application have been described in detail above. However, this application is not limited to the specific details of the above embodiments. Within the scope of the technical concept of this application, various simple modifications can be made to the technical solution of this application, and these simple modifications all fall within the protection scope of this application.
[0121] It should also be noted that the various specific technical features described in the above embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, this application will not describe the various possible combinations separately.
[0122] Furthermore, various different implementations of this application can be combined in any way, as long as they do not violate the spirit of this application, they should also be regarded as the content disclosed in this application.
Claims
1. A method for classifying materials, characterized in that, This classification method includes: Traverse the model files to create a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. The first dataset includes identifiers for components with unspecified material geometric faces but no material parameters in their instance parameters. The second dataset includes identifiers for the type of each component in the first dataset. The third dataset includes identifiers for the type of components belonging to the system family in the first dataset. The fourth dataset includes identifiers for the type of components belonging to the loaded family in the first dataset. The fifth dataset includes identifiers for components with unspecified material geometric faces and material parameters in their instance parameters. The sixth dataset includes identifiers for materials whose material classification attributes do not conform to a preset specification for components without unspecified material geometric faces. The seventh dataset includes the correspondence between the identifiers of materials whose material classification attributes do not conform to the preset specification in the sixth dataset and the identifiers of components using materials whose material classification attributes do not conform to the preset specification in the sixth dataset. For each object in each of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined by combining the AI large language model, and the determined recommended material type is assigned to the material classification attribute of the object.
2. The classification method according to claim 1, characterized in that, For any object in any of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined using an AI large language model, including: Construct classification prompts that enable the AI large language model to analyze material types; Construct a request body that includes the classification prompt words and the parameters required to invoke the AI large language model service; Send the request body to the API interface of the AI large language model; Obtain the analysis results of the AI large language model based on the request body; The analysis results are processed and combined with a preset list of material types to determine recommended material types.
3. The classification method according to claim 2, characterized in that, Constructing classification prompts for the AI large language model to analyze material types, including: If any object in any of the datasets is a type in the third dataset, the fourth dataset, or a component in the fifth dataset, the corresponding component core attributes are obtained. Based on the component core attributes and a preset material type list, classification prompts are constructed to enable the AI large language model to analyze material types. The component core attributes include: category name, family name, type name, instance name; and / or If any object in either of the datasets is a material in the sixth dataset, a classification prompt word is constructed based on the material name and usage environment of the material, enabling the AI large language model to analyze the material type.
4. The classification method according to claim 1, characterized in that, For any object in any of the third, fourth, fifth, and sixth datasets, the determined recommended material type is assigned to the object's material classification attribute, including: If any object in either of the datasets is a material in the sixth dataset, the determined recommended material type is assigned to the material classification attribute of the material. If any object in any of the above is a type of the third dataset, the fourth dataset, or a component of the fifth dataset, perform the following: Determine if the material category attribute is empty; Determine whether the material classification attribute is a read-only parameter; If the material classification attribute is not a read-only parameter, perform the following: Verify whether the material classification attribute can be written; When the material classification attribute can be written, based on the determined recommended material type and the preset standard material library, the identification identifier corresponding to the determined recommended material type is determined, and the determined identification identifier is assigned to the material classification attribute; When the material classification attribute is a read-only parameter, the object is of the type in the third dataset. The composite structure corresponding to the object is obtained, the composite structure is traversed to determine the layer corresponding to the empty material classification attribute, the identity identifier corresponding to the determined recommended material type is determined based on the determined recommended material type and the preset standard material library, and the determined identity identifier is assigned to the material classification attribute of the determined layer.
5. The classification method according to claim 4, characterized in that, Create a preset standard material library, including: For each material type in the preset material type list, perform the following: Determine if the same material type exists in the Revit project; If it exists, the correspondence between the material type and the corresponding identifier is stored in a preset dictionary structure; If it does not exist, a new material type is created, and the correspondence between the new material type and the identity identifier corresponding to the material type is stored in the preset dictionary structure.
6. The classification method according to claim 1, characterized in that, Iterate through the model files to create the first dataset, second dataset, third dataset, fourth dataset, fifth dataset, sixth dataset, and seventh dataset, including: For each component in the model file, perform the following: Traverse the geometric faces of the component and determine whether there are any geometric faces of the component with unspecified materials; If the component has geometric faces with unspecified materials, then the following steps are performed: Store the identity identifier of the component in the first dataset; Store the identifier of the component type in the second dataset; Determine whether the family of the component is a system family or a loading family. If the family of the component is a system family, store the identity identifier of the component type in the third dataset. If the family of the component is a loading family, store the identity identifier of the component type in the fourth dataset. Determine whether there is a material parameter in the instance parameters of the component. If there is a material parameter in the instance parameters of the component, move the component's identifier from the first dataset to the fifth dataset. If the component does not have any geometric facets with unspecified materials but has materials whose material classification attributes do not conform to the preset specifications, then the identifiers of the materials whose material classification attributes do not conform to the preset specifications are stored in the sixth dataset, and the correspondence between the materials whose material classification attributes do not conform to the preset specifications and the component is stored in the seventh dataset.
7. A material classification device, characterized in that, The classification device includes: A module is established to traverse model files and create a first dataset, a second dataset, a third dataset, a fourth dataset, a fifth dataset, a sixth dataset, and a seventh dataset. The first dataset includes identifiers of components with unspecified material geometric faces but no material parameters in their instance parameters. The second dataset includes identifiers of the type of each component in the first dataset. The third dataset includes identifiers of the type of components belonging to the system family in the first dataset. The fourth dataset includes identifiers of the type of components belonging to the loaded family in the first dataset. The fifth dataset includes identifiers of components with unspecified material geometric faces but material parameters in their instance parameters. The sixth dataset includes identifiers of materials whose material classification attributes do not conform to a preset specification for components without unspecified material geometric faces. The seventh dataset includes the correspondence between the identifiers of materials whose material classification attributes do not conform to the preset specification in the sixth dataset and the identifiers of components using materials whose material classification attributes do not conform to the preset specification in the sixth dataset. The determination module is used to determine the corresponding recommended material type for each object in each of the third dataset, the fourth dataset, the fifth dataset, and the sixth dataset, in conjunction with the AI large language model, and assign the determined recommended material type to the material classification attribute of the object.
8. The classification device according to claim 7, characterized in that, For any object in any of the third, fourth, fifth, and sixth datasets, the corresponding recommended material type is determined using an AI large language model, including: Construct classification prompts that enable the AI large language model to analyze material types; Construct a request body that includes the classification prompt words and the parameters required to invoke the AI large language model service; Send the request body to the API interface of the AI large language model; Obtain the analysis results of the AI large language model based on the request body; The analysis results are processed and combined with a preset list of material types to determine recommended material types.
9. The classification device according to claim 8, characterized in that, Constructing classification prompts for the AI large language model to analyze material types, including: If any object in any of the datasets is a type in the third dataset, the fourth dataset, or a component in the fifth dataset, the corresponding component core attributes are obtained. Based on the component core attributes and a preset material type list, classification prompts are constructed to enable the AI large language model to analyze material types. The component core attributes include: category name, family name, type name, instance name; and / or If any object in either of the datasets is a material in the sixth dataset, a classification prompt word is constructed based on the material name and usage environment of the material, enabling the AI large language model to analyze the material type.
10. The classification device according to claim 7, characterized in that, The determining module assigns the determined recommended material type to the material classification attribute of any object in any of the third dataset, the fourth dataset, the fifth dataset, and the sixth dataset, including: If any object in either of the datasets is a material in the sixth dataset, the determined recommended material type is assigned to the material classification attribute of the material. If any object in any of the above is a type of the third dataset, the fourth dataset, or a component of the fifth dataset, perform the following: Determine if the material category attribute is empty; Determine whether the material classification attribute is a read-only parameter; If the material classification attribute is not a read-only parameter, perform the following: Verify whether the material classification attribute can be written; When the material classification attribute can be written, based on the determined recommended material type and the preset standard material library, the identification identifier corresponding to the determined recommended material type is determined, and the determined identification identifier is assigned to the material classification attribute; When the material classification attribute is a read-only parameter, the object is of the type in the third dataset. The composite structure corresponding to the object is obtained, the composite structure is traversed to determine the layer corresponding to the empty material classification attribute, the identity identifier corresponding to the determined recommended material type is determined based on the determined recommended material type and the preset standard material library, and the determined identity identifier is assigned to the material classification attribute of the determined layer.
11. The classification device according to claim 10, characterized in that, Create a preset standard material library, including: For each material type in the preset material type list, perform the following: Determine if the same material type exists in the Revit project; If it exists, the correspondence between the material type and the corresponding identifier is stored in a preset dictionary structure; If it does not exist, a new material type is created, and the correspondence between the new material type and the identity identifier corresponding to the material type is stored in the preset dictionary structure.
12. The classification device according to claim 7, characterized in that, The creation module traverses the model files to create the first dataset, the second dataset, the third dataset, the fourth dataset, the fifth dataset, the sixth dataset, and the seventh dataset, including: For each component in the model file, perform the following: Traverse the geometric faces of the component and determine whether there are any geometric faces of the component with unspecified materials; If the component has geometric faces with unspecified materials, then the following steps are performed: Store the identity identifier of the component in the first dataset; Store the identifier of the component type in the second dataset; Determine whether the family of the component is a system family or a loading family. If the family of the component is a system family, store the identity identifier of the component type in the third dataset. If the family of the component is a loading family, store the identity identifier of the component type in the fourth dataset. Determine whether there is a material parameter in the instance parameters of the component. If there is a material parameter in the instance parameters of the component, move the component's identifier from the first dataset to the fifth dataset. If the component does not have any geometric facets with unspecified materials but has materials whose material classification attributes do not conform to the preset specifications, then the identifiers of the materials whose material classification attributes do not conform to the preset specifications are stored in the sixth dataset, and the correspondence between the materials whose material classification attributes do not conform to the preset specifications and the component is stored in the seventh dataset.
13. A machine-readable storage medium, characterized in that, The machine-readable storage medium stores instructions for causing the machine to perform the classification method according to any one of claims 1-6.
14. An electronic device, characterized in that, The electronic device includes: processor; Memory used to store the processor's executable instructions; The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the classification method according to any one of claims 1-6.
Citation Information
Patent Citations
Sorting system family library construction method and device, computer equipment and storage medium
CN114692358A
Material attribute acquisition method and system based on large language model and BIM
CN119516287A