BIM component parameter adding method and device, storage medium and electronic equipment
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHINA SOUTHWEST ARCHITECTURAL DESIGN & RES INST CORP LTD
- Filing Date
- 2022-12-21
- Publication Date
- 2026-08-07
AI Technical Summary
对于第二种方式和第三种方式得到的BIM构件常常是难以满足不同类型建筑企业的BIM构件标准,也就无法展开相关应用,也就意味着出现上述三种情况时需对BIM构件进行改造,增加BIM构件的几何参数和非几何参数,以满足应用需求
[0029]相对于现有技术,本申请实施例所提供的一种BIM构件参数添加方法、装置、存储介质及电子设备,包括:从待添加的族文件中确定一个目标族文件,其中,目标族文件包括至少一个BIM构件;在参数列表中还包括任意一个待添加状态的参数的情况下,选择一个待添加状态的参数作为目标参数;在目标族文件中不存在目标参数的情况下,将目标参数添加至目标族文件;将目标参数修改为已添加状态;确定参数列表中是否还包括待添加状态的参数;若还包括待添加状态的参数,则重复选择一个待添加状态的参数作为目标参数,直至参数列表中的所有参数均为已添加状态;若参数列表中的所有参数均为已添加状态,则将目标族文件修改为已添加状态;确定是否还存在待添加的族文件;若是,则将参数列表中的所有参数修改为待添加状态,重复从待添加的族文件中确定一个目标族文件,直至所有的族文件均完成参数添加。通过上述的遍历循环方式,可以将参数列表中的所有参数批量添加至所有的待添加的族文件中,不需要工作人员一一添加,进而可以节省大量的时间,提升工作效率。
Smart Images

Figure CN116011065B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of building information modeling, and more specifically, to a method, apparatus, storage medium, and electronic device for adding BIM component parameters. Background Technology
[0002] BIM component libraries are crucial data assets for companies in the construction industry. BIM components are the basic units that make up a BIM model, containing both geometric and non-geometric information. They are essential for expressing design intent and ensuring design quality and efficiency. Integrating BIM components that conform to application standards to create BIM component libraries is a vital step for construction companies to accelerate BIM model building and a significant measure for solidifying domain and corporate knowledge.
[0003] There are three approaches to expanding the BIM component library: first, creating new BIM components; second, importing external BIM components; and third, extracting BIM components from the BIM model. The first approach, commonly used by enterprises, simply requires ensuring that the relevant geometric and non-geometric information of the BIM component meets the parameters during the creation process. However, the standards are often modified based on the evolving BIM application within the enterprise. BIM components obtained through the second and third approaches often fail to meet the BIM component standards of different types of construction companies, thus hindering their application. This means that in the above three situations, the BIM components need to be modified by adding geometric and non-geometric parameters to meet application requirements.
[0004] However, how to quickly and efficiently add parameters has become a difficult problem for those skilled in the art. Summary of the Invention
[0005] The purpose of this application is to provide a method, apparatus, storage medium, and electronic device for adding BIM component parameters, so as to at least partially improve the above-mentioned problems.
[0006] To achieve the above objectives, the technical solutions adopted in the embodiments of this application are as follows:
[0007] In a first aspect, embodiments of this application provide a method for adding BIM component parameters, the method comprising:
[0008] Determine a target family file from the family files to be added, wherein the target family file includes at least one BIM component;
[0009] If the parameter list also includes any parameter of a state to be added, select one parameter of the state to be added as the target parameter;
[0010] If the target parameter does not exist in the target family file, the target parameter is added to the target family file;
[0011] Modify the target parameter to show that it has been added;
[0012] Determine whether the parameter list still includes parameters for which a state needs to be added;
[0013] If there are still parameters in the pending state, then repeatedly select one parameter in the pending state as the target parameter until all parameters in the parameter list are in the added state;
[0014] If all parameters in the parameter list are in an added state, then the target family file is modified to an added state;
[0015] Determine if there are any family files that need to be added;
[0016] If so, all parameters in the parameter list are changed to the pending state, and a target family file is repeatedly selected from the family files to be added, until all family files have completed parameter addition.
[0017] Secondly, embodiments of this application provide a BIM component parameter adding device, the device comprising:
[0018] A processing unit is configured to determine a target family file from the family files to be added, wherein the target family file includes at least one BIM component;
[0019] The processing unit is also configured to select a parameter of a state to be added as the target parameter if the parameter list also includes any parameter of a state to be added.
[0020] An adding unit is configured to add the target parameter to the target family file if the target parameter does not exist in the target family file.
[0021] The processing unit is also used to modify the target parameter to an added state;
[0022] The processing unit is also used to determine whether the parameter list still includes parameters for which a state needs to be added;
[0023] The processing unit is further configured to, if there are still parameters in the state to be added, repeatedly select one parameter in the state to be added as the target parameter, until all parameters in the parameter list are in the added state;
[0024] The processing unit is further configured to modify the target family file to the added state if all parameters in the parameter list are in the added state.
[0025] The processing unit is also used to determine whether there are any family files to be added;
[0026] The processing unit is further configured to, if yes, modify all parameters in the parameter list to a pending state, and repeatedly determine a target family file from the family files to be added, until all family files have completed parameter addition.
[0027] Thirdly, embodiments of this application provide a storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described method.
[0028] Fourthly, embodiments of this application provide an electronic device, the electronic device comprising: a processor and a memory, the memory being used to store one or more programs; when the one or more programs are executed by the processor, the above-described method is implemented.
[0029] Compared to existing technologies, the present application provides a method, apparatus, storage medium, and electronic device for adding BIM component parameters, comprising: determining a target family file from a family file to be added, wherein the target family file includes at least one BIM component; if the parameter list also includes any parameter in a state to be added, selecting a parameter in a state to be added as the target parameter; if the target parameter does not exist in the target family file, adding the target parameter to the target family file; modifying the target parameter to an added state; determining whether the parameter list also includes parameters in a state to be added; if it does, repeatedly selecting a parameter in a state to be added as the target parameter until all parameters in the parameter list are in an added state; if all parameters in the parameter list are in an added state, modifying the target family file to an added state; determining whether there are still family files to be added; if so, modifying all parameters in the parameter list to a state to be added, and repeatedly determining a target family file from the family files to be added until all family files have completed parameter addition. By using the above iterative loop method, all parameters in the parameter list can be added in batches to all family files to be added, eliminating the need for staff to add them one by one, thus saving a lot of time and improving work efficiency.
[0030] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description
[0031] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0032] Figure 1 This is a schematic diagram of the parameter acquisition interface provided in an embodiment of this application;
[0033] Figure 2 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application;
[0034] Figure 3 This is one of the flowcharts illustrating the method for adding BIM component parameters provided in the embodiments of this application;
[0035] Figure 4 A schematic diagram of the sub-steps of S111 provided in the embodiments of this application;
[0036] Figure 5 The second flowchart illustrates the method for adding BIM component parameters provided in the embodiments of this application.
[0037] Figure 6 The third flowchart illustrating the method for adding BIM component parameters provided in this application embodiment;
[0038] Figure 7 This is a schematic diagram of the plug-in interface provided in an embodiment of this application;
[0039] Figure 8 Figure 4 A schematic diagram of the sub-steps of S103 provided in the embodiments of this application;
[0040] Figure 9 A schematic diagram of a BIM component parameter adding device provided in an embodiment of this application.
[0041] In the diagram: 10-Processor; 11-Memory; 12-Bus; 13-Communication Interface; 201-Processing Unit; 202-Addition Unit. Detailed Implementation
[0042] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.
[0043] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0044] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0045] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0046] In the description of this application, it should be noted that the terms "upper", "lower", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings, or the orientation or positional relationship that the product of this application is usually placed in. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0047] In the description of this application, it should also be noted that, unless otherwise explicitly specified and limited, the terms "set" and "connection" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this application based on the specific circumstances.
[0048] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.
[0049] The parameters that need to be added in this application scheme include family parameters and shared parameters, which can be, but are not limited to, the compiler software Revit.
[0050] Family parameters control the variable values of a family, such as size or material. Family parameters are specific to the current family.
[0051] Shared parameters are parameters that can be used across multiple families and projects. Once a shared parameter definition is added to a family or project, it can be used as a family or project parameter. Optionally, shared parameters are defined in a shared parameter file (.txt) outside of Revit to prevent changes.
[0052] The parameters that need to be added in this application can also be divided into type parameters and instance parameters.
[0053] The type parameter defines parameters for the family type. Once the value of the type parameter is modified, the parameter values of all individual type instances, i.e., family instances, will change accordingly. When the parameter value of one family instance of the same family type is changed, the parameter values of the other family instances will also change accordingly.
[0054] Instance parameters are parameters defined for family instances. When the parameter value of a family instance changes, the value of other family instances of the same family type will not change.
[0055] Optionally, the information contained in the parameters includes: major, parameter name, parameter type, parameter value, and grouping method.
[0056] The majors include architecture, structural engineering, water supply and drainage, heating, ventilation and air conditioning, and electrical engineering.
[0057] The parameter name is a string.
[0058] The parameter types need to be considered in relation to the corresponding professional fields. Table 1, which summarizes the parameter types and their corresponding professional fields frequently encountered by enterprises, is shown below:
[0059]
[0060]
[0061] Table 1
[0062] Optionally, grouping methods may include restrictions, text, size standards, identification data, and others.
[0063] Regarding how to obtain parameter information, this application embodiment also provides a possible implementation method, please refer to the following.
[0064] The first step is to set up the parameter acquisition interface and obtain the corresponding parameters based on the parameter acquisition interface.
[0065] Adding a parameter to a family requires information including: specialty, parameter name, parameter type, parameter value, and grouping method. Therefore, a retrieval interface needs to be set up for each piece of information, and the corresponding parameter information needs to be determined based on the user's input on the retrieval interface.
[0066] Specifically, the specialty in the parameter can be obtained in the following way: instantiate the C# ComboBox class, set a drop-down list control, and the drop-down options include: architecture, structure, water supply and drainage, HVAC and electrical. The specialty corresponding to the parameter is determined based on the user's click command on the drop-down list control.
[0067] The parameter name can be obtained in the following way: instantiate the C# TextBox class, set a text edit box, and the user can enter the command information through the text edit box to determine the parameter name.
[0068] The parameter type in the parameters is obtained in the following way: To set the interface style of the parameter type, it is first necessary to determine the current major, and then call the C# ComboBox class to instantiate it. The drop-down options are set as shown in Table 1. Then, the parameter type corresponding to the parameter is determined based on the user's click command on the drop-down list control.
[0069] The parameter values are obtained by instantiating a C# TextBox class, setting up a text edit box, and allowing the user to input instructions through the text edit box to determine the corresponding parameter values.
[0070] The grouping method in the parameters is obtained as follows: Instantiate the C# ComboBox class, set a drop-down list control, and the options of the control include: restrictions, text, size standard, identifier data and others. The grouping method corresponding to the parameters is determined based on the user's click command on the drop-down list control.
[0071] Furthermore, based on obtaining the corresponding parameters, it can be determined whether the parameters are type parameters or instance parameters.
[0072] For the same parameter information, setting the parameter as a type parameter will affect all family instances of the same type, while setting the parameter as an instance parameter will only affect the current family instance. When adding parameters to a component, the category of the parameter needs to be determined.
[0073] In the parameter acquisition interface, the selection is made using the settings button (the first button). This is achieved by instantiating a RadioButton, which allows staff to determine whether the current parameter is a type parameter or an instance parameter.
[0074] Furthermore, the parameters can be identified as family parameters or shared parameters.
[0075] In the parameter acquisition interface, select the parameter category using the settings button (second button): shared parameter or family parameter, which is achieved by instantiating a RadioButton.
[0076] Alternatively, please refer to Figure 1 , Figure 1 A schematic diagram of the parameter acquisition interface provided in the embodiments of this application.
[0077] Regarding the method of parameter storage, this application embodiment also provides a possible implementation method, please refer to the following.
[0078] Since each parameter contains information, including: family parameter / shared parameter, type parameter / instance parameter, specialty, parameter name, parameter type, parameter value, and grouping method, a single parameter can be stored using a class. In C#, declare a `FamilyParamInfo` class and add the following properties to this class: `ParamName` (string) representing the parameter name; `IsShareParam` (bool) representing whether the current parameter is a family parameter or a shared parameter; `IsInstance` (bool) representing whether the current parameter is a type parameter or an instance parameter; `ParamType` (string) representing the parameter type; `ParamValue` (string) representing the parameter value; and `GroupType` (string) representing the grouping method. Optionally, multiple parameters can be stored using a list.
[0079] It should also be noted that in scenarios involving the modification of existing BIM components to comply with the application standards of BIM components used by construction companies, it is necessary to add geometric and non-geometric parameters to the BIM components. Currently, the main method for adding BIM component parameters is to open a single BIM component and add them one by one using the "Family Type" function. However, the modification of BIM components often involves modifying multiple BIM components at the same time, therefore, the current method of BIM component modification is inefficient.
[0080] To overcome the above problems, this application provides a method for adding BIM component parameters to a circuit, which solves the problem of inefficient addition by adding parameters in batches. Specifically, it is applied to the electronic equipment described below.
[0081] This application provides an electronic device, which may be a computer device, a server device, or other smart terminal devices. Please refer to... Figure 2 This is a schematic diagram of the structure of an electronic device. The electronic device includes a processor 10, a memory 11, and a bus 12. The processor 10 and the memory 11 are connected via the bus 12. The processor 10 is used to execute executable modules, such as computer programs, stored in the memory 11.
[0082] Processor 10 can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the BIM component parameter addition method can be completed through the integrated logic circuitry in the hardware or software instructions within processor 10. The aforementioned processor 10 can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0083] The memory 11 may include high-speed random access memory (RAM) and may also include non-volatile memory, such as at least one disk storage device.
[0084] Bus 12 can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. Figure 2 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus 12 or one type of bus 12.
[0085] The memory 11 is used to store programs, such as the program corresponding to the BIM component parameter adding device. The BIM component parameter adding device includes at least one software function module that can be stored in the memory 11 in the form of software or firmware or embedded in the operating system (OS) of the electronic device. After receiving the execution instruction, the processor 10 executes the program to implement the BIM component parameter adding method.
[0086] The electronic device provided in this application embodiment may also include a communication interface 13. The communication interface 13 is connected to the processor 10 via a bus. The electronic device can obtain user-input instructions and other information through the communication interface 13.
[0087] It should be understood that, Figure 2 The structure shown is only a partial schematic diagram of the electronic device; the electronic device may also include components that are larger than... Figure 2 The more or fewer components shown, or having the same Figure 2 The different configurations shown. Figure 2 The components shown can be implemented using hardware, software, or a combination thereof.
[0088] The BIM component parameter addition method provided in this application embodiment can be applied to, but is not limited to, [various applications]. Figure 2 For the specific process of the electronic devices shown, please refer to [link / reference]. Figure 3 The methods for adding BIM component parameters include: S104, S105, S111, S112, S113, S114, S115 and S116, which are described in detail below.
[0089] S104, determine a target family file from the family files to be added.
[0090] The target family file includes at least one BIM component.
[0091] Optionally, the family files to be added can be stored in a family file list, and each family file to be added will be identified as the target family file in turn, thereby completing the parameter addition.
[0092] It's important to note that BIM components are replaceable entities within the entire BIM model. They possess unique and irreplaceable functions, conform to the interface standards of the entire BIM model, and can be assembled with other components to ultimately form the BIM model. Revit family files: Any 3D model element in Revit is generated based on families. A family is a class of elements, grouped based on shared parameter sets, common uses, and similar appearances. Simply put, a family is a type of entity module that includes general attributes, view attributes, and annotation attributes. All structural components added to the 3D model, such as ceilings, walls, floors, doors, windows, stairs, and ramps, are created using families.
[0093] S105, if the parameter list also includes any parameter of a state to be added, select a parameter of the state to be added as the target parameter.
[0094] Optionally, by taking the parameters of each state to be added as target parameters one by one, all the parameters of the states to be added can be added as target parameters to the corresponding target family file.
[0095] S111, if the target parameter does not exist in the target family file, add the target parameter to the target family file.
[0096] It should be understood that if the target parameters already exist in the target family file, and the addition fails this time, an error can be reported, or the process can be skipped directly.
[0097] S112, change the target parameter to the added state.
[0098] It should be understood that by changing the target parameter to an "added" state, duplicate additions are avoided.
[0099] S113, determine if the parameter list still includes parameters for the state to be added. If yes, repeat S105; otherwise, execute S114.
[0100] It should be understood that if the parameter list still includes parameters in the pending addition state, it means that the addition is not complete, and S105 needs to be executed again until all parameters in the parameter list are in the added state. When all parameters in the parameter list are in the added state, it means that the parameter list does not include parameters in the pending addition state, which means that the addition of parameters for the target family file is complete, and S114 can be executed.
[0101] S114. If all parameters in the parameter list are in the "added" state, then modify the target family file to the "added" state.
[0102] It should be understood that by changing the target family file to an added status, the duplicate addition of parameters to a family file that has already been added is avoided.
[0103] S115: Determine if there are any family files to be added. If yes, proceed to S116; otherwise, end.
[0104] It should be understood that if there are still family files to be added in the family file list, it means that the addition is not yet complete, and S116 needs to be executed again to change all parameters in the parameter list to the pending state. Then, all parameters in the parameter list can be added to the new target family file until all family files have completed parameter addition. Otherwise, the process ends.
[0105] S116, change all parameters in the parameter list to the pending addition state.
[0106] It should be understood that after S116, the parameters of the states to be added in the parameter list can be added to the new target family file.
[0107] By using the above iterative loop method, all parameters in the parameter list can be added in batches to all family files to be added, eliminating the need for staff to add them one by one, thus saving a lot of time and improving work efficiency.
[0108] In summary, this application provides a method for adding BIM component parameters, comprising: determining a target family file from family files to be added, wherein the target family file includes at least one BIM component; if the parameter list also includes any parameter in a state to be added, selecting a parameter in a state to be added as the target parameter; if the target parameter does not exist in the target family file, adding the target parameter to the target family file; changing the target parameter to an added state; determining whether the parameter list also includes parameters in a state to be added; if it does, repeatedly selecting a parameter in a state to be added as the target parameter until all parameters in the parameter list are in an added state; if all parameters in the parameter list are in an added state, changing the target family file to an added state; determining whether there are still family files to be added; if so, changing all parameters in the parameter list to a state to be added, and repeatedly determining a target family file from the family files to be added until all family files have completed parameter addition. Through the above iterative loop, all parameters in the parameter list can be added in batches to all family files to be added, eliminating the need for staff to add them one by one, thus saving significant time and improving work efficiency.
[0109] exist Figure 3 Based on this, for the content in S111, this application embodiment also provides a possible implementation method, please refer to... Figure 4 S111 includes: S111-1, S111-2, S111-3 and S111-4, which are described in detail below.
[0110] S111-1, Map the target parameters based on a preset mapping function to obtain the mapped value.
[0111] Since the parameter information input by users is in string format, which does not meet the data format requirements of BIM design software (such as Revit) API when adding parameters, it is necessary to build format mapping functions, including parameter type mapping functions and grouping method mapping functions.
[0112] The parameters obtained from the front end are represented by Chinese strings such as "text", "integer", "angle", "speed", and "length". In the secondary development of BIM design software (such as Revit), all parameter types need to be converted to Int type integers. Specific examples are shown in Tables 2 and 3, where Table 2 is an example of parameter type data format mapping and Table 3 is an example of grouping method data format mapping.
[0113] Parameter type Mapping function output Integer 1 (ParameterType) angle 7 (ParameterType) speed 213 (ParameterType) length 4 (ParameterType) …… ……
[0114] Table 2
[0115] Grouping Mapping function output Limitations -5000119 (BuiltInParameterGroup type) Word -5000123 (BuiltInParameterGroup type) Dimensioning -5000101 (BuiltInParameterGroup type) Identification data -5000100 (BuiltInParameterGroup type) …… ……
[0116] Table 3
[0117] Specifically, when the input parameter is an integer, the mapping function outputs the integer 2; when the input parameter is an angle, the mapping function outputs the integer 7. See the Revit API for detailed mapping rules.
[0118] The grouping types obtained from the front end are identified using Chinese characters such as "Restriction", "Text", "Dimension", and "Identification Data". In Revit secondary development, all grouping types need to be converted to integer values. For example, when the grouping type is "Restriction", the mapping function outputs the integer -5000119; when the grouping type is "Text", the mapping function outputs the integer -5000123.
[0119] S111-2, determine whether the target parameter is a shared parameter or a family parameter. If it is a shared parameter, execute S111-3; if it is a family parameter, execute S111-4.
[0120] Because family parameters and shared parameters differ significantly not only in their usage effects but also in how they are automatically added to components in a program, it is necessary to implement the addition of family parameters and shared parameters separately.
[0121] S111-3, when the target parameter is a shared parameter, the mapping value is added to the target family file based on the shared parameter function.
[0122] Optionally, S111-3 includes sub-steps one through seven, as detailed below.
[0123] Sub-step 1: Use the Document.Application.OpenDocumentFile() function to open the family file.
[0124] Sub-step 2: Obtain the FamilyManager class from the family file.
[0125] Sub-step 3: Create a new shared parameter file and assign the new shared parameter file to the family file by calling the Document.Application.SharedParametersFilename property.
[0126] Sub-step four: Call the Document.Application.OpenSharedParameterFile() function to open the shared parameter file.
[0127] Sub-step 5: Create a new shared parameter group for the shared parameter file: This is achieved by calling the DefinitionFile.Groups.Create() function.
[0128] Sub-step six: Instantiate the ExternalDefinitionCreationOptions class, put the parameter names and parameter types into the class, and convert them to ExternalDefinition.
[0129] Sub-step seven: Call the FamilyManager.AddParameter() function to pass the result of sub-step six, the parameter grouping method mapping, and whether it is an instance parameter to the function, thereby adding the shared parameter to the family file.
[0130] S111-4, When the target parameter is a family parameter, the mapping value is added to the target family file based on the family parameter function.
[0131] Optionally, S111-4 includes sub-steps one through four, as detailed below.
[0132] Sub-step 1: Use the Document.Application.OpenDocumentFile() function to open the family file.
[0133] Sub-step 2: Obtain the FamilyManager class from the family file.
[0134] Sub-step 3: Obtain the parameter type mapping and group type mapping of the parameters through the mapping function.
[0135] Sub-step four: Call the FamilyManager.AddParameter() function, input the parameter name, grouping method mapping, parameter type mapping, and whether it is an instance parameter or a shared parameter boolean value, to add the parameter to the family file.
[0136] exist Figure 4 Based on S111-3 and S111-4, this application embodiment also provides a possible implementation, please refer to the following.
[0137] Check if the parameter value is a size; if so, convert it to feet; call the FamilyManager.Set() function to assign a value to the newly added parameter.
[0138] exist Figure 3 Based on this, regarding how to determine whether target parameters exist in the target family file, embodiments of this application also provide an optional implementation method, please refer to... Figure 5 Following S105, the methods for adding BIM component parameters also include: S106, S107, S108, S109, and S110, which are described in detail below.
[0139] S106, retrieve the parameter names of all existing parameters in the target family file.
[0140] Optionally, S106 includes sub-steps one through three, as detailed below.
[0141] Sub-step 1: Open the family file using the Document.Application.OpenDocumentFile() function.
[0142] Sub-step 2: Obtain the FamilyManager class from the family file.
[0143] Sub-step 3: Retrieve all existing parameters from the family file, i.e., all existing parameters in the FamilyParameterSet, from the FamilyManager class of the family.
[0144] S107, determine whether the parameter name of the target parameter is the same as the parameter name of any existing parameter in the target family file. If yes, proceed to S108; otherwise, proceed to S110.
[0145] Optionally, iterate through the FamilyParameterSet and check if the name of any existing parameter in the target family file appears in the list of parameters to be added. If it appears, it means that the new parameter already exists in the family file; if it does not appear, it means that the new parameter does not exist in the family file.
[0146] Alternatively, the parameter names of the target parameters can be compared one by one with the parameter names of any existing parameter in the target family file to determine if they are the same.
[0147] S108, confirm that target parameters exist in the target family file.
[0148] After S108, you can skip the target parameter and add other parameters, i.e., execute S109, or you can report an error.
[0149] S109, if target parameters exist in the target family file, change the target parameters to the added state.
[0150] S110, Determines that the target parameter does not exist in the target family file.
[0151] After S110, execute S111.
[0152] exist Figure 3 Based on this, regarding how to obtain the family file to be added, this application embodiment also provides an optional implementation method, please refer to... Figure 6 Prior to S104, the methods for adding BIM component parameters also included S101, S102, and S103, which are described in detail below.
[0153] S101, based on preset suffixes, filters out family files to be added from the batch files selected by the user.
[0154] Optionally, S101 includes sub-steps one through three, as detailed below.
[0155] Sub-step 1: Call the C# OpenFileDialog class. Instantiating this class allows a file dialog box to pop up when a button is clicked. In the specific class instantiation, properties are set for the OpenFileDialog class. Key properties include: setting the Multiselect property to true to enable multi-file selection, and setting the Filter property to "family file (*.rfa)|*.rfa" as the default file extension to ensure that selected files must be family files.
[0156] Sub-step 2: Set up a list, which can be named "files", to store the family file paths obtained in sub-step 1.
[0157] Sub-step 3: Call the C# DataGridViewTextBoxCell class. Instantiating this class allows you to view the family file obtained in Step 1 using the OpenFileDialog class in the plugin interface. Specifically, during class instantiation, the family file name is first assigned to the DataGridViewTextBoxCell's Value property, and the folder name where the file is located is also assigned to the DataGridViewTextBoxCell's Value property.
[0158] Then the DataGridViewTextBoxCell.Cells.Add() function displays the family file name and the folder name where the family file name is located on the interface.
[0159] By following these three steps, you can click the "Select Files" button on the interface to open a folder containing selected family files. After selecting multiple family files, their information is saved in the backend's "files" list, and the selected family files can be viewed in the plugin interface. Specifically, as follows... Figure 7 As shown, Figure 7 This is a schematic diagram of the plug-in interface provided in an embodiment of this application.
[0160] S102, Remove duplicate family files from all family files to be added.
[0161] Optionally, when selecting family files in batches, due to the large number of family files, staff often need to obtain all the family files that need to be modified in several batches. During these batches, staff can easily select duplicate family files. To avoid adding parameters to the same family files repeatedly, further judgment is required.
[0162] The OpenFileDialog class is used to obtain multiple family files. The family file name and the folder path where the family file is located are extracted. Then, they are compared with the family file name and the path of the family file already stored in the DataGridViewTextBoxCell. The specific comparison rule is: if the obtained family file name and the folder path of the family file are exactly the same as those stored in the DataGridViewTextBoxCell, it means that the current family file is duplicated; otherwise, it means that it is not duplicated, and it is added to the flies list and displayed in the interface.
[0163] S103, remove family files whose version information is higher than the current version information of the BIM design software.
[0164] Optionally, adding parameters to a Revit family file on the current computer requires that the family file can be opened in Revit. If the family file version is higher than Revit, the operator cannot open the family file and therefore cannot add parameters. Therefore, when acquiring family files in batches, this application needs to obtain the version of each family file and the current Revit version, and perform a version comparison.
[0165] Optionally, the corresponding file can also be removed based on the click command of the staff.
[0166] When adding family files, since enterprises often need to manipulate many family files, to avoid having to re-select a few unnecessary family files during batch selection, a function to remove family files needs to be added to the batch family file acquisition module. To implement this function, a double-click event can be displayed on the line character of the family file in WinForms. When a user double-clicks the family file to be removed on the interface, the corresponding family file will be removed. Simultaneously, the double-clicked family file name will be located in the files list of added family files and removed.
[0167] exist Figure 6 Based on the above, regarding the content in S103, this application embodiment also provides a possible implementation method, please refer to... Figure 8 S103 includes: S103-1, S103-2, S103-3 and S103-4, which are described in detail below.
[0168] S103-1, obtain the version information of each family file to be added and the current version information of the BIM design software.
[0169] Optionally, the family file can be opened as a FileStream to obtain its byte array, which is then converted to a String using Unicode encoding. For a 2018 version family file, the conversion result will contain the string "2018," and for a 2019 version family file, the result will contain the string "2019." Similarly, for family files of the corresponding Revit version, the conversion result will contain the corresponding version's string. Therefore, the version information of the family file can be obtained by checking for the presence of this string using regular expressions.
[0170] Alternatively, the current version of the Revit program can be obtained by calling Document.Application.VersionNumber in the BIM design software (such as Revit) package.
[0171] S103-2, Determine if the version information of the family file to be added is higher than the current version information of the BIM design software. If yes, proceed to S103-3; otherwise, proceed to S103-4.
[0172] Optionally, the obtained family file version information is compared with the obtained Revit version information in turn. If the family file version is higher than the Revit version, it is not added to the files list for storage and is not displayed in the plugin interface.
[0173] S103-3, Remove family files whose version information is higher than the current version information of the BIM design software.
[0174] S103-4, retained.
[0175] The BIM component parameter addition method provided in this application embodiment can add multiple types of parameters to multiple BIM components at one time, which greatly improves the transformation efficiency of existing BIM components, externally introduced BIM components, and BIM components extracted from BIM models. It is an important step for enterprises to quickly create BIM component libraries.
[0176] Please see Figure 9 , Figure 9 The present application provides a BIM component parameter adding device, which is optionally applied to the electronic device described above.
[0177] The BIM component parameter adding device includes: processing unit 201 and adding unit 202.
[0178] Processing unit 201 is configured to determine a target family file from the family file to be added, wherein the target family file includes at least one BIM component;
[0179] The processing unit 201 is also used to select a parameter of a state to be added as the target parameter if the parameter list also includes any parameter of a state to be added.
[0180] Adding unit 202 is used to add the target parameters to the target family file when the target parameters do not exist in the target family file;
[0181] Processing unit 201 is also used to modify the target parameter to an added state;
[0182] Processing unit 201 is also used to determine whether the parameter list still includes parameters for the state to be added;
[0183] The processing unit 201 is also configured to, if there are still parameters to be added, repeatedly select one parameter to be added as the target parameter until all parameters in the parameter list are in the added state;
[0184] The processing unit 201 is also used to modify the target family file to the added state if all parameters in the parameter list are in the added state;
[0185] Processing unit 201 is also used to determine whether there are any family files to be added;
[0186] The processing unit 201 is also used to modify all parameters in the parameter list to the state of being to be added if the condition is met, and repeatedly determine a target family file from the family files to be added, until all family files have completed the parameter addition.
[0187] Optionally, the processing unit 201 may execute S101-S111 and S113-S116 as described above, and the adding unit 202 may execute S112 as described above.
[0188] It should be noted that the BIM component parameter adding device provided in this embodiment can execute the method flow shown in the above-described method flow embodiment to achieve the corresponding technical effects. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above-described embodiments.
[0189] This application also provides a storage medium storing computer instructions and programs, which, when read and run, execute the BIM component parameter addition method described above. The storage medium may include memory, flash memory, registers, or a combination thereof.
[0190] The following provides an electronic device, which may be a computer device, a server device, or other intelligent terminal device. This electronic device, such as... Figure 2 As shown, the above-described method for adding BIM component parameters can be implemented. Specifically, the electronic device includes: a processor 10, a memory 11, and a bus 12. The processor 10 may be a CPU. The memory 11 is used to store one or more programs, which, when executed by the processor 10, execute the BIM component parameter adding method of the above embodiment.
[0191] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.
[0192] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0193] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0194] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
[0195] It will be apparent to those skilled in the art that this application is not limited to the details of the exemplary embodiments described above, and that this application can be implemented in other specific forms without departing from the spirit or essential characteristics of this application. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of this application is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within this application. No reference numerals in the claims should be construed as limiting the scope of the claims.
Claims
1. A method for adding parameters to BIM components, characterized in that, The method includes: Determine a target family file from the family files to be added, wherein the target family file includes at least one BIM component; If the parameter list also includes any parameter of a state to be added, select one parameter of the state to be added as the target parameter; If the target parameter does not exist in the target family file, the target parameter is added to the target family file; Modify the target parameter to show that it has been added; Determine whether the parameter list still includes parameters for which a state needs to be added; If there are still parameters in the pending state, then repeatedly select one parameter in the pending state as the target parameter until all parameters in the parameter list are in the added state; If all parameters in the parameter list are in an added state, then the target family file is modified to an added state; Determine if there are any family files that need to be added; If so, all parameters in the parameter list are changed to the pending state, and a target family file is repeatedly selected from the family files to be added, until all family files have completed parameter addition.
2. The BIM component parameter addition method as described in claim 1, characterized in that, The step of adding the target parameters to the target family file includes: The target parameters are mapped based on a preset mapping function to obtain the mapped value; The target parameter is determined to be a shared parameter or a family parameter; When the target parameter is a shared parameter, the mapping value is added to the target family file based on the shared parameter function; When the target parameter is a family parameter, the mapping value is added to the target family file based on the family parameter function.
3. The BIM component parameter addition method as described in claim 1, characterized in that, After selecting a parameter of the state to be added as the target parameter, the method further includes: Obtain the parameter names of all existing parameters in the target family file; Determine whether the parameter name of the target parameter is the same as the parameter name of any existing parameter in the target family file; If so, then it is determined that the target parameter exists in the target family file; If not, then it is determined that the target parameter does not exist in the target family file.
4. The BIM component parameter addition method as described in claim 1, characterized in that, The method further includes: If the target parameter exists in the target family file, the target parameter will be changed to an added state.
5. The BIM component parameter addition method as described in claim 1, characterized in that, Before determining a target family file from the family files to be added, the method further includes: Based on preset suffixes, filter out the family files to be added from the batch files selected by the user.
6. The BIM component parameter addition method as described in claim 5, characterized in that, After selecting family files to be added from a batch of files chosen by the user based on a preset suffix, the method further includes: Remove duplicate family files from all family files to be added; Remove family files whose version information is higher than the current version information of the BIM design software.
7. The BIM component parameter addition method as described in claim 6, characterized in that, The step of removing family files whose version information is higher than the current version information of the BIM design software includes: Obtain the version information of each family file to be added and the current version information of the BIM design software; Determine whether the version information of the family file to be added is higher than the current version information of the BIM design software; If so, remove family files whose version information is higher than the current version information of the BIM design software; If not, then keep it.
8. A BIM component parameter adding device, characterized in that, The device includes: A processing unit is configured to determine a target family file from the family files to be added, wherein the target family file includes at least one BIM component; The processing unit is also configured to select a parameter of a state to be added as the target parameter if the parameter list also includes any parameter of a state to be added. An adding unit is configured to add the target parameter to the target family file if the target parameter does not exist in the target family file. The processing unit is also used to modify the target parameter to an added state; The processing unit is also used to determine whether the parameter list still includes parameters for which a state needs to be added; The processing unit is further configured to, if there are still parameters in the state to be added, repeatedly select one parameter in the state to be added as the target parameter, until all parameters in the parameter list are in the added state; The processing unit is further configured to modify the target family file to the added state if all parameters in the parameter list are in the added state. The processing unit is also used to determine whether there are any family files to be added; The processing unit is further configured to, if yes, modify all parameters in the parameter list to a pending state, and repeatedly determine a target family file from the family files to be added, until all family files have completed parameter addition.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method as described in any one of claims 1-7.
10. An electronic device, characterized in that, include: Processor and memory, the memory being used to store one or more programs; When the one or more programs are executed by the processor, the method as described in any one of claims 1-7 is implemented.
Citation Information
Patent Citations
Revit-based map making project sample plate manufacturing method
CN106777748A
Modeling method and device for highway tunnel project
CN109918832A