Data processing method and device, computer device, and storage medium

By acquiring Revit family files and parsing element attribute information, the problem of data extraction for secondary rendering of graphics was solved, enabling effective information acquisition and parametric modeling of Revit files.

CN114417064BActive Publication Date: 2026-04-07SHENZHEN POWER SUPPLY BUREAU
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-12-14
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies cannot effectively address the data extraction requirements for secondary graphics rendering, and traditional ODA components cannot provide effective information.

Method used

By acquiring Revit family files, converting them into file object model structure data, traversing and parsing the elements, and storing the element attribute information into an Extensible Markup Language (XML) file, parametric modeling is achieved.

Benefits of technology

It enables the acquisition of Revit file information and parametric modeling, and supports secondary rendering of graphics.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114417064B_ABST
    Figure CN114417064B_ABST
Patent Text Reader

Abstract

The application relates to a data analysis method and device, computer equipment, a storage medium and a computer program product. The method comprises the following steps: obtaining a Revit family file, converting the Revit family file into file object model structure data; traversing the file object model structure data to obtain various types of graphic elements; analyzing each type of graphic element to obtain attribute information of each type of graphic element; and storing each type of graphic element and the attribute information in an extensible markup language file corresponding to the Revit family file, so that the extensible markup language file can be read to realize parameterized modeling, and thus the Revit file information can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of 3D modeling technology, and in particular to a data processing method, apparatus, computer equipment, storage medium, and computer program product. Background Technology

[0002] With the development of 3D modeling technology, model data extraction technology has emerged. Currently, traditional Official Development Assistance (ODA) components can meet daily data extraction requirements, but they cannot provide effective information for secondary rendering of graphics. Summary of the Invention

[0003] Therefore, it is necessary to provide a data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product to address the aforementioned technical problems.

[0004] Firstly, this application provides a data processing method. The method includes: acquiring a Revit family file and converting the Revit family file into file object model structure data;

[0005] Traverse the file object model structure data to obtain primitives of various types;

[0006] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0007] Each type of graphic element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0008] In one embodiment, converting the Revit family file into file object model structure data includes:

[0009] The Revit family file is loaded using the Document method to obtain the file object model structure data.

[0010] In one embodiment, the step of parsing each type of primitive to obtain the attribute information of each type of primitive includes:

[0011] Parse the Revit file to obtain element manipulation functions;

[0012] The attribute information of each type of graphic element is obtained by parsing the graphic element operation function.

[0013] In one embodiment, the method further includes:

[0014] Read the Extensible Markup Language (XML) file corresponding to the Revit family file, and obtain the attribute information of the primitives in the XML file;

[0015] The generation method of the graphic element is obtained from its attribute information, and the parameter model type is determined based on the generation method.

[0016] A parametric model is generated based on the primitives, the parametric model type, and the constraints, with the attribute information of the primitives as variables, wherein the constraints are used to constrain the relationships between primitives.

[0017] In one embodiment, generating a parametric model with attribute information of the primitives as variables based on the primitives, the parametric model type, and constraints includes:

[0018] Generate a parametric model framework based on the parametric model type and constraints;

[0019] The primitives are added to the parameter model framework and drawn to obtain a parameter model with the attribute information of the primitives as variables.

[0020] In one embodiment, the method further includes:

[0021] Receive parameter modification instructions, and modify the parameter values ​​and corresponding constraints according to the parameter modification instructions;

[0022] The parameter model is adjusted based on the modified parameter values ​​and constraints.

[0023] Secondly, this application also provides a data processing apparatus, the apparatus comprising:

[0024] The conversion module is used to obtain Revit family files and convert the Revit family files into file object model structure data.

[0025] The traversal module is used to traverse the file object model structure data to obtain primitives of various types.

[0026] The parsing module is used to parse each type of graphic element to obtain the attribute information of each type of graphic element;

[0027] The storage module is used to store each type of graphic element and its attribute information in the Extensible Markup Language file corresponding to the Revit family file.

[0028] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to perform the following steps:

[0029] Obtain the Revit family file and convert it into file object model structure data;

[0030] Traverse the file object model structure data to obtain primitives of various types;

[0031] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0032] Each type of graphic element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0033] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:

[0034] Obtain the Revit family file and convert it into file object model structure data;

[0035] Traverse the file object model structure data to obtain primitives of various types;

[0036] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0037] Each type of graphic element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0038] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:

[0039] Obtain the Revit family file and convert it into file object model structure data;

[0040] Traverse the file object model structure data to obtain primitives of various types;

[0041] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0042] Each type of graphic element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0043] The aforementioned data processing method, apparatus, computer equipment, storage medium, and computer program product acquire Revit family files, convert the Revit family files into file object model structure data, traverse the file object model structure data to obtain various types of primitives, parse each type of primitive to obtain attribute information for each type of primitive, and store each type of primitive and its attribute information in an Extensible Markup Language (XML) file corresponding to the Revit family file. This XML file can be read to achieve parametric modeling, thereby enabling the acquisition of Revit file information. Attached Figure Description

[0044] Figure 1 This is a diagram illustrating the application environment of a data processing method in one embodiment.

[0045] Figure 2 This is a flowchart illustrating a data processing method in one embodiment;

[0046] Figure 3 This is a flowchart illustrating one data processing step in one embodiment;

[0047] Figure 4 This is a flowchart illustrating a data processing method in another embodiment;

[0048] Figure 5 This is a schematic diagram of a parametric model in one embodiment;

[0049] Figure 6 This is a structural block diagram of a data processing device in one embodiment;

[0050] Figure 7 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0051] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0052] The data processing method provided in this application embodiment can be applied to, for example... Figure 1The application environment shown is as follows. Terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be integrated onto server 104 or placed on a cloud or other network server. Server 104 obtains Revit family files from terminal 102, converts the Revit family files into file object model structure data; traverses the file object model structure data to obtain various types of primitives; parses each type of primitive to obtain attribute information for each type of primitive; and stores each type of primitive and its attribute information in the corresponding Extensible Markup Language (XML) file of the Revit family file. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. Server 104 can be implemented using a standalone server or a server cluster composed of multiple servers.

[0053] In one embodiment, such as Figure 2 As shown, a data processing method is provided, which can be applied to... Figure 1 Taking the server in the example, the following steps are included:

[0054] Step 202: Obtain the Revit family file and convert it into file object model structure data.

[0055] In Revit, families are a powerful and essential concept. Each Revit family file contains numerous parameters and information, such as dimensions, shape, type, and other parameter variables. The Document Object Model (DOM) is a W3C-recommended standard programming interface for processing Extensible Markup Language (EXPLAIN). The DOM is a platform- and language-independent Application Programming Interface (API) that allows dynamic access to programs and scripts to update their content, structure, and style (HTML and XML documents are defined through the specification section). Documents can be further processed, and the results can be added to the current page. The DOM consists of three parts: the core, the HTML interface, and the XML interface. The core is a collection of low-level objects that structure the document; the objects defined in this part can fully express any data in HTML and XML documents. Revit family files can be converted into Document Object Model structured data using Document loading.

[0056] Specifically, the processor obtains the Revit family file and then converts the Revit family file into file object model structure data.

[0057] Step 204: Traverse the file object model structure data to obtain primitives of various types.

[0058] Traversal refers to visiting each node in a tree (or graph) sequentially along a search path. The operations performed on each node depend on the specific application problem; these operations might include checking or updating the node's value. A primitive refers to any graphical representation composed of several different points, lines, or surfaces, or cyclical combinations of identical patterns. These points, lines, and surfaces are the basic graphical elements. Traversal methods mainly include: traversing a List by retrieving its elements and traversing a List using an iterator, where a List represents an ordered collection of elements. There are two common data structures for implementing Lists: arrays and linked lists. Different methods are implemented internally for different List data structures.

[0059] Specifically, the processor first obtains the collection of elements in the Collection, then obtains the iterator corresponding to the collection, and then traverses the elements in the collection to obtain primitives of various types.

[0060] Step 206: parse each type of graphic element to obtain the attribute information of each type of graphic element.

[0061] In this context, primitive attributes refer to the display characteristics that control primitives. Primitive attribute information includes, but is not limited to, point attributes, line attributes, line type attributes, fill area attributes, regions, characters, and primitive generation methods. Point attributes include color and size; in raster systems, points of various sizes are displayed using square pixel arrays. Line attributes include color, width, and type. Line width is specified as a multiple of the standard single pixel width. Line type attributes include solid lines, dashed lines, and dotted lines, as well as various brush or pen types. Fill area attributes include solid color fill, patterned fill, or hollow fill that only displays the region boundary. Various patterned fills are described using color arrays, mapped to the interior of the region. Characters include color, size, spacing, and direction.

[0062] Specifically, the processor parses each type of primitive to obtain the attribute information of each type of primitive.

[0063] Step 208: Store each type of element and its attribute information in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0064] Extensible Markup Language (XML) is a subset of Standard Generalized Markup Language (SGML). It is a markup language used to structure electronic documents.

[0065] Specifically, the processor acquires the information of each type of graphic element and its attributes, and then stores the information of each type of graphic element and its attributes in the Extensible Markup Language file corresponding to the Revit family file.

[0066] In the above data processing method, a Revit family file is obtained, and the Revit family file is converted into file object model structure data; the file object model structure data is traversed to obtain the primitives of each type; the attribute information of each type of primitive is obtained by parsing; the primitives and attribute information are stored in the Extensible Markup Language (XML) file corresponding to the Revit family file, and the XML file can be read to realize parametric modeling, thereby enabling the Revit file information to be obtained.

[0067] In one embodiment, converting a Revit family file into document object model structure data includes: loading the Revit family file by loading a Document to obtain the document object model structure data.

[0068] The DOM contains many different types of nodes, much like atoms contain subatomic particles; similarly, many types of DOM nodes contain other types of nodes. These include element nodes, text nodes, and attribute nodes. Element nodes are atoms in the DOM. DOM element nodes can be accessed through the top-level document node, through their parent node, through adjacent nodes, and through their child nodes. Text nodes are a type of element node. For example, on our homepage, ' The element contains the text "Shared by: 'Xiaoming'". "Xiaoming" is a text node, and text nodes are always contained within element nodes. Attribute nodes are used to provide more specific descriptions of elements.

[0069] Specifically, the processor parses the HTML files in the Revit family file, loads external scripts and styles, parses and executes the scripts within the document, fully constructs the HTML DOM, loads images and external content, and finally obtains the file object model structure data after the webpage is loaded.

[0070] In this embodiment, the Revit family file is loaded by loading a Document, thus obtaining the object model structure.

[0071] In one embodiment, parsing each type of graphic element to obtain attribute information for each type of graphic element includes: parsing the Revit file to obtain graphic element operation functions; and parsing each type of graphic element according to the graphic element operation functions to obtain attribute information for each type of graphic element.

[0072] Primitive manipulation functions are used for drawing primitives. Primitives are described using ordered sets of vertices. In using primitive manipulation functions, the pair glBegain() and glEnd() is most commonly used. The parameter passed to glBegain() uniquely determines which geometric primitive to draw, and the definition of the geometric primitive is given in this function pair. The function glEnd() marks the end of the vertex list.

[0073] Specifically, the processor parses the Revit file to obtain element operation functions, and then parses each type of element according to the obtained element operation functions to obtain the attribute information of each type of element.

[0074] In this embodiment, the attribute information of each type of graphic element is obtained by acquiring the graphic element operation function.

[0075] In one embodiment, the above data processing method further includes:

[0076] Step 302: The processor reads the Extensible Markup Language (XML) file corresponding to the Revit family file, and then obtains the attribute information of the primitives in the XML file.

[0077] Specifically, the processor first reads the XML file in the Revit family file and obtains the element attribute information in the XML file.

[0078] Step 304: Obtain the generation method of the graphic element from the attribute information of the graphic element, and determine the parameter model type based on the generation method.

[0079] The methods for generating primitives include Extrusion, Blend, Revolution, Sweep, and SweptBlend. Extrusion stretches lines within a primitive proportionally. Blend merges multiple shapes together, such as two circles. Revolution rotates a shape around a fixed point by a certain angle to create a different shape. Sweep uses a 2D object as a cross-section along a path to form a complex 3D object. A SweptBlend requires a reference line to define the loft path, then drawing two contours at the ends of the reference line, and finally selecting both the reference line and the two contours to create the shape.

[0080] Specifically, the processor obtains the generation method of the primitive from the primitive's attribute information, and then determines the parameter model type based on the primitive's generation method.

[0081] Step 306: Generate a parametric model with the attribute information of the graphic elements as variables based on the graphic elements, the parametric model type, and the constraints.

[0082] Specifically, the processor acquires the primitives, parametric model types, and constraints, and generates a parametric model with the attribute information of the primitives as variables based on the primitives, parametric model types, and constraints.

[0083] In this embodiment, the parameters for constructing the model are obtained through the attribute information of the graphic elements.

[0084] In one embodiment, generating a parametric model with attribute information of the graphic elements as variables based on graphic elements, parametric model type, and constraints includes: generating a parametric model framework based on the parametric model type and constraints; adding the graphic elements into the parametric model framework and drawing them to obtain a parametric model with attribute information of the graphic elements as variables.

[0085] Constraints refer to additional conditions governing the relationships between graphs. A variable is a concept in computer languages ​​that stores calculation results or represents values. Variables can be accessed through their names. In imperative languages, variables are usually mutable; however, in purely functional languages ​​(such as Haskell), variables may be immutable.

[0086] Specifically, first, preset constraints and one or more attribute information of the graphic elements are used as variables. The processor obtains the parameter model type and constraints, then generates a parameter model framework based on the parameter model type and constraints. The graphic elements are added to the parameter model framework for drawing to obtain a parameter model with the attribute information of the graphic elements as variables.

[0087] In this embodiment, a parameterized model can be established through the parameter model and constraints.

[0088] In one embodiment, the method further includes: receiving a parameter modification instruction, modifying the parameter value and corresponding constraints according to the parameter modification instruction, and adjusting the parameter model according to the modified parameter value and constraints.

[0089] Among them, parameter modification instructions refer to instructions generated to modify the parameters of the constructed model. For example, when the processor obtains an operation to modify the attribute information in the parameter model constructed with the attribute information of primitives as variables, it generates the corresponding parameter modification instructions.

[0090] Specifically, the processor first receives a parameter modification instruction, modifies the parameter values ​​and corresponding constraints according to the instruction, and then adjusts the parameter model based on the modified parameter values ​​and constraints. For example, the processor obtains that the length of a primitive changes from S1 to S2, where S2 is greater than S1, and then renders and generates a new parameter model based on the modified parameter value S2 and the constraints.

[0091] In this embodiment, the construction of the parameterized model can be adjusted by modifying the parameters.

[0092] The data processing method provided in this application obtains element information by parsing Revit family files, thereby enabling the establishment of a parametric model. A detailed implementation example is provided below. Figure 4 The following describes the specific steps of the data processing method:

[0093] (1) Load the Revit family file by loading the Document, obtain the DOM structure data, and get all the elements ElementCollector through the Document;

[0094] (2) Traverse the DOM structure data to obtain all types of primitives;

[0095] (3) Use C# to parse Revit family files and obtain element operation functions;

[0096] (4) Based on the primitive operation function, perform different parsing for different primitives to obtain the attribute information of the primitives;

[0097] (5) Store all types of graphic elements and their attributes in an XML file;

[0098] (6) Read and parse the XML file to obtain the attribute information of the graphic elements;

[0099] (7) Determine the model construction type by reading the primitive generation method from the primitive attribute information.

[0100] (8) Use the attribute information of the primitives as parameters of the model, and process the primitive modeling through the drawing function of the Operation Control Center (OCC) in the open source modeling library.

[0101] Parametric modeling primarily involves using graphs, parameters, variables, and constraints, such as... Figure 6 As shown, the graphics can be rendered a second time by setting variables and constraints.

[0102] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.

[0103] Based on the same inventive concept, this application also provides a data processing apparatus for implementing the data processing method described above. The solution provided by this apparatus is similar to the implementation scheme described in the above method; therefore, the specific limitations in one or more data processing apparatus embodiments provided below can be found in the limitations of the data processing method described above, and will not be repeated here.

[0104] In one embodiment, such as Figure 6 As shown, a data processing device is provided, including: a conversion module 610, a traversal module 620, a parsing module 630, and a storage module 640, wherein:

[0105] The conversion module 610 is used to obtain Revit family files and convert them into file object model structure data.

[0106] Traversal module 620 is used to traverse the file object model structure data to obtain primitives of various types;

[0107] The parsing module 630 is used to parse each type of graphic element to obtain the attribute information of each type of graphic element;

[0108] Storage module 640 is used to store each type of element and its attribute information in an Extensible Markup Language file corresponding to the Revit family file.

[0109] In one embodiment, the data processing apparatus includes: a loading module, configured to load the Revit family file by loading a Document, thereby obtaining file object model structure data.

[0110] In one embodiment, the parsing module 630 is used to parse the Revit file to obtain element operation functions; and to parse each type of element according to the element operation functions to obtain the attribute information of each type of element.

[0111] In one embodiment, the data processing apparatus further includes: an acquisition module for reading an Extensible Markup Language (XML) file corresponding to a Revit family file, acquiring attribute information of the elements in the XML file; acquiring the generation method of the elements from the attribute information, determining the parametric model type based on the generation method; and generating a parametric model with the attribute information of the elements as variables based on the elements, the parametric model type, and constraints.

[0112] In one embodiment, the data processing apparatus includes a generation module and a drawing module. The generation module generates a parametric model framework based on the parametric model type and constraints; the drawing module adds primitives into the parametric model framework and draws them to obtain a parametric model with the attribute information of the primitives as variables.

[0113] In one embodiment, the data processing apparatus includes a modification module and an adjustment module. The modification module receives parameter modification instructions and modifies the parameter values ​​and corresponding constraints according to the instructions; the adjustment module adjusts the parameter model according to the modified parameter values ​​and constraints.

[0114] Each module in the aforementioned data processing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.

[0115] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 7 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores processed data. The network interface communicates with external terminals via a network connection. When executed by the processor, the computer program implements a data processing method.

[0116] Those skilled in the art will understand that Figure 7 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0117] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to perform the following steps:

[0118] Obtain Revit family files and convert them into file object model structure data;

[0119] Traverse the file object model structure data to obtain primitives of various types;

[0120] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0121] Each type of element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0122] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0123] By loading Revit family files using the Document method, the file object model structure data can be obtained.

[0124] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0125] Parse the Revit file to obtain element manipulation functions;

[0126] The primitive operation function is used to parse each type of primitive to obtain the attribute information of each type of primitive.

[0127] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0128] Read the Extensible Markup Language (XML) file corresponding to the Revit family file and obtain the attribute information of the primitives in the XML file;

[0129] Obtain the generation method of the graphic element from its attribute information, and determine the parameter model type based on the generation method;

[0130] Generate a parametric model with the attribute information of the graphic elements as variables based on the graphic elements, the parametric model type, and the constraints. The constraints are used to constrain the relationships between the graphic elements.

[0131] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0132] Generate a parametric model framework based on the parametric model type and constraints;

[0133] Adding primitives to the parametric model framework and drawing them results in a parametric model with the attribute information of the primitives as variables.

[0134] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0135] Receive parameter modification instructions and modify the parameter values ​​and corresponding constraints according to the instructions.

[0136] The parameter model is adjusted based on the modified parameter values ​​and constraints.

[0137] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon, the computer program performing the following steps when executed by a processor:

[0138] Obtain Revit family files and convert them into file object model structure data;

[0139] Traverse the file object model structure data to obtain primitives of various types;

[0140] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0141] Each type of element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0142] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0143] By loading Revit family files using the Document method, the file object model structure data can be obtained.

[0144] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0145] Parse the Revit file to obtain element manipulation functions;

[0146] The primitive operation function is used to parse each type of primitive to obtain the attribute information of each type of primitive.

[0147] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0148] Read the Extensible Markup Language (XML) file corresponding to the Revit family file and obtain the attribute information of the primitives in the XML file;

[0149] Obtain the generation method of the graphic element from its attribute information, and determine the parameter model type based on the generation method;

[0150] Generate a parametric model with the attribute information of the graphic elements as variables based on the graphic elements, the parametric model type, and the constraints. The constraints are used to constrain the relationships between the graphic elements.

[0151] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0152] Generate a parametric model framework based on the parametric model type and constraints;

[0153] Adding primitives to the parametric model framework and drawing them results in a parametric model with the attribute information of the primitives as variables.

[0154] In one embodiment, when the computer program is executed by a processor, it also performs the following steps:

[0155] Receive parameter modification instructions and modify the parameter values ​​and corresponding constraints according to the instructions.

[0156] The parameter model is adjusted based on the modified parameter values ​​and constraints.

[0157] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps:

[0158] Obtain Revit family files and convert them into file object model structure data;

[0159] Traverse the file object model structure data to obtain primitives of various types;

[0160] The attribute information of each type of graphic element is obtained by parsing each type of graphic element;

[0161] Each type of element and its attribute information is stored in the Extensible Markup Language (XML) file corresponding to the Revit family file.

[0162] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0163] By loading Revit family files using the Document method, the file object model structure data can be obtained.

[0164] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0165] Parse the Revit file to obtain element manipulation functions;

[0166] The primitive operation function is used to parse each type of primitive to obtain the attribute information of each type of primitive.

[0167] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0168] Read the Extensible Markup Language (XML) file corresponding to the Revit family file and obtain the attribute information of the primitives in the XML file;

[0169] Obtain the generation method of the graphic element from its attribute information, and determine the parameter model type based on the generation method;

[0170] Generate a parametric model with the attribute information of the graphic elements as variables based on the graphic elements, the parametric model type, and the constraints. The constraints are used to constrain the relationships between the graphic elements.

[0171] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0172] Generate a parametric model framework based on the parametric model type and constraints;

[0173] Adding primitives to the parametric model framework and drawing them results in a parametric model with the attribute information of the primitives as variables.

[0174] In one embodiment, the processor, when executing a computer program, also performs the following steps:

[0175] Receive parameter modification instructions and modify the parameter values ​​and corresponding constraints according to the instructions.

[0176] The parameter model is adjusted based on the modified parameter values ​​and constraints.

[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0178] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.

[0179] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0180] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A data processing method, characterized in that, The method includes: Obtain the Revit family file and convert it into file object model structure data; Traverse the file object model structure data to obtain primitives of various types; For each type of graphic element, the attribute information of each type of graphic element is obtained by parsing; the attribute information includes one of the following: point attribute, line attribute, line type attribute, fill area attribute, area, character, and graphic element generation method; Each type of graphic element and its attribute information is stored in the Extensible Markup Language file corresponding to the Revit family file; Also includes: Read the Extensible Markup Language (XML) file corresponding to the Revit family file, and obtain the attribute information of the primitives in the XML file; The generation method of the graphic element is obtained from its attribute information, and the parameter model type is determined according to the generation method; the generation method includes at least one of stretching, blending, rotation, lofting, and lofting blending. Generate a parametric model framework based on the parametric model type and constraints; The primitives are added to the parameter model framework and drawn to obtain a parameter model with the attribute information of the primitives as variables. The constraints are used to constrain the relationships between primitives. The constraints refer to additional conditions on the relationships between primitives.

2. The method according to claim 1, characterized in that, The process of converting the Revit family file into file object model structure data includes: The Revit family file is loaded using the Document method to obtain the file object model structure data.

3. The method according to claim 1, characterized in that, The process of parsing each type of graphic element to obtain its attribute information includes: Parse the Revit file to obtain element manipulation functions; The attribute information of each type of graphic element is obtained by parsing the graphic element operation function.

4. The method according to claim 1, characterized in that, The method further includes: Receive parameter modification instructions, and modify the parameter values ​​and corresponding constraints according to the parameter modification instructions; The parameter model is adjusted based on the modified parameter values ​​and constraints.

5. A data parsing device, characterized in that, The device includes: The conversion module is used to obtain Revit family files and convert the Revit family files into file object model structure data. The traversal module is used to traverse the file object model structure data to obtain primitives of various types. The parsing module is used to parse each type of graphic element to obtain the attribute information of each type of graphic element; the attribute information includes one of point attribute, line attribute, line type attribute, fill area attribute, area, character, and graphic element generation method; The storage module is used to store each type of graphic element and its attribute information in the Extensible Markup Language file corresponding to the Revit family file; The parsing module is also used to read the Extensible Markup Language (XML) file corresponding to the Revit family file and obtain the attribute information of the primitives in the XML file; It is also used to obtain the generation method of the primitive from the attribute information of the primitive, and determine the parameter model type according to the generation method; the generation method includes at least one of stretching, blending, rotation, lofting, and lofting blending; It is also used to generate a parameter model framework based on the parameter model type and constraints; add the primitives to the parameter model framework and draw them to obtain a parameter model with the attribute information of the primitives as variables, wherein the constraints are used to constrain the relationships between primitives; the constraints refer to additional conditions on the relationships between primitives.

6. The apparatus according to claim 5, characterized in that, Also includes: The loading module is used to load the Revit family file by loading a Document, thereby obtaining the file object model structure data.

7. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method for showing summarized information of power station primitives

    CN103412744A

  • Online editing method and device, electronic equipment and storage medium

    CN113591197A