Three-dimensional model information attribute adding and outputting method based on CAD
By developing three-dimensional model information attribute addition and output plug-in in CAD, the problem of BIM software lacking cut function and CAD cannot output information attribute details list is solved, and the information attributes of CAD three-dimensional model are automatically attached and output to form construction information Model, improves information statistics efficiency and data security.
Patent Information
- Application Number
- CN202411294127.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-14
- Publication Date
- 2025-02-11
- Estimated Expiration
- 2044-09-14
AI Technical Summary
Existing BIM software such as Revit lacks the cutting function, making it difficult to refine large-scale engineering models to the minimum construction unit level, and cannot meet the needs of construction management. At the same time, although traditional CAD software has cutting function, it cannot add and output three-dimensional models. Information attribute list.
Develop a CAD-based three-dimensional model information attribute addition and output method, write through the .NET open source development platform, C# language and Winform form, develop plug-ins to realize the addition, batch sorting and output of custom attributes, and export detailed lists using NPOI package files. .
The information attributes of CAD three-dimensional model are automatically batch-attached and output, forming a construction information model, improving information statistics efficiency, reducing the quality threshold for modeling personnel, and enhancing data storage and security.
Smart Images

Figure CN119418017A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of engineering BIM modeling, and in particular relates to a method for adding and outputting three-dimensional model information attributes based on CAD. Background Art
[0002] CAD (Autodesk Computer Aided Design) is currently the most widely used 2D and 3D engineering drawing software. Building Information Modeling (BIM) has developed rapidly on the basis of CAD. It can integrate various types of information throughout the life cycle of a project based on a 3D model, thereby assisting project management. It has now become a key tool for the digital transformation of the engineering industry. The most fundamental advantage of BIM over traditional CAD 3D drawing is that the model can be attached to many engineering information attributes, while traditional CAD often only uses layers (colors) to distinguish models, cannot add model attributes, and does not have the function of batch output of detailed tables such as bills of quantities. For example, when counting the amount of concrete engineering, it is necessary to enter commands for each component to obtain the volume, and then manually paste the data into the table. When constructing large-scale water conservancy and hydropower projects such as dams and sluice gates or other large-scale construction models, the whole is usually built first and then cut into the smallest construction unit. The number of components is often as many as thousands. However, Revit, the most widely used BIM software, does not have a cutting function, which makes it impossible to decompose the model finely to the unit level and fail to meet construction management requirements. Relatively speaking, CAD's cutting function is more convenient, and the file format is more universal and compatible. Therefore, it is necessary to design a CAD-based 3D model information attribute addition and output method to solve the above problems. Summary of the invention
[0003] The technical problem to be solved by the present invention is to provide a CAD-based three-dimensional model information attribute adding and output method, which is used to solve the problem of adding information attributes and outputting attribute detailed lists of CAD three-dimensional models. By developing an information attribute management plug-in, the model units in CAD can automatically batch mount engineering information attributes, or manually mount any unique attributes, and automatically output attribute detailed lists such as bills of quantities, and finally form a construction information model for construction process management, which greatly improves the efficiency of information statistics.
[0004] In order to achieve the above technical effects, the technical solution adopted by the present invention is: A method for adding and outputting 3D model information attributes based on CAD, comprising the following steps: S1, establish a large-scale engineering overall three-dimensional model in CAD, and cut the three-dimensional model into several model units as objects to which information attributes are added to form an initial construction model; S2, using .NET open source development platform, C# language and Winform to develop a plug-in module for adding custom attributes, and manually add any attributes and attribute values; S3, using the selection sort algorithm, develop a module to add attributes in batches according to the regular order preset by the model; S4, develop a module for obtaining the model's own information, and automatically batch retrieve the model's own information attributes; S5, develop a module for obtaining custom attributes of the model, retrieve custom attributes and display them in the CAD form, so as to quickly view all custom attribute information of the model and form a construction information model; S6. Use the NPOI package file to develop an export detail list module and select the attribute output detail list.
[0005] Preferably, in step S1, the model unit is a minimum construction unit model divided step by step into units, divisions, sub-items and processes.
[0006] Preferably, in step S2, any attribute and attribute value is a custom attribute, which is stored using a data extension dictionary (ExtensionDictionary) inside the CAD.
[0007] Furthermore, the extended dictionary inherits from the DBDictionary object, which is a container for storing non-graphic objects in CAD. The dictionary exists in two forms, one is stored in the database to save the data of the entire drawing, called NameDictionaries (named object dictionary), and the other is stored in the object to save the object's information data, called ExtensionDictionary (object extension dictionary). Using the data extension dictionary to store related attributes and attribute values can be saved in the DWG file of the CAD to prevent data loss.
[0008] Preferably, in step S2, when adding custom attributes, the existence of the entity's data extension dictionary is judged, and the permission upgrade function (UpgradeOpen) is performed by obtaining the entity's DBObject object to complete the entity's extension dictionary creation (CreateExtensionDictionary), and after the creation is completed, the object permissions are downgraded (DowngradeOpen).
[0009] Preferably, in step S3, the preset regular order is the order of x, y, and z coordinates of the component's center of mass in a spatial rectangular coordinate system; after selecting the x direction, y direction, or z direction method in the plug-in interface, the entities are sorted from small to large in the xyz direction through an algorithm based on the center of mass coordinates of the entity.
[0010] Preferably, in step S3, the sorting algorithm includes a CAD built-in API method, converting the entity (Entity) into a 3D entity (Solid3d) using the as keyword, reading the centroid attribute of the entity, sorting the ObjectId of the selected entity, and sorting using a selection sorting algorithm.
[0011] Furthermore, in CAD, most entities are regular, and their mass centers will not be offset outside the entity, which will not affect the coordinate components of their mass centers, so they can be sorted using this method.
[0012] Preferably, in step S3, batch adding of attributes is implemented by using a custom function AddDictionaryItem, and the specific method is as follows: Get the entity DBObject object and open its write mode (OpenMode.ForWrite); Create an Xrecord record and store the attributes into a temporary List list through key-value pairs; The values in the list are passed to the dictionary using the SetAt function, and then created into the database (AddNewlyCreatedDBObject) to complete batch attribute addition.
[0013] Preferably, in step S4, the model built-in information is the volume, area and coordinate information that comes with the model after it is established; taking the model volume as an example, the volume information of the entity is read by obtaining the ObjectId of the entity through the CAD built-in function, and is linked to its entity ID (ObjectId) to assist in the calculation of the bill of quantities.
[0014] The method to retrieve model information is: First, obtain the transaction object (Transaction) through the transaction mode of CAD, and convert the selected Object object into a readable entity (Entity) and 3D solid (Solid3D) through its function of obtaining the Object object (GetObject). Then, obtain the entity ID through the entity's ObjectId, and obtain the volume information by reading the Volume in the MassProperties attribute of the 3D solid.
[0015] Preferably, in step S5, the execution method of calling the model custom attribute module is: Use the GetDictionaryFirstString function through the built-in API method of CAD to obtain the ObjectId of the entity, and then obtain the DBObject object through the ObjectId to open the data dictionary and read the attributes; Custom attributes can be modified and deleted. To modify, pass in new attributes through the custom function SetDictionaryItem to perform replacement operations, and to delete, use the custom function DeleteKeyValue to perform deletion operations. Both of the above custom functions use the entity's DBObject to operate its data extension dictionary. The construction information model is a model that is broken down into processes based on the construction detailed design model, and its attributes are expanded and given construction information. It is used for construction management and digital delivery.
[0016] Preferably, in step S6, the detailed list is a detailed list including entity ID, custom attributes and attribute values, and entity volume attributes; the method for exporting the detailed list is: Create a detailed list through NPOI and system I / O package methods; The information read from CAD is integrated into DataTable, and then IWorkbook is created and the data is written through the method in the NPOI package. Finally, the detailed list is saved and output through the system I / O package.
[0017] The beneficial effects of the present invention are as follows: 1. This application avoids the defect that Revit software cannot cut, uses CAD modeling and cutting, lowers the quality threshold of modeling personnel, and the format is more versatile and compatible, so that large-scale engineering models can be refined to the smallest model unit.
[0018] 2. This application can automatically retrieve the model volume, area and other built-in information attributes in batches to assist in the calculation of the bill of quantities.
[0019] 3. This application enables CAD model units to batch mount any information attributes to meet construction management requirements.
[0020] 4. This application batch outputs information attribute detailed tables to reduce a lot of information statistics work.
[0021] 5. XData data storage has an upper limit, generally 16kb, but the extended dictionary of this application can reach 2GB of data storage by using Xrecord data extension records. Custom attributes are mounted in the data dictionary instead of XData, and cannot be read by CAD's own commands. It can also store multiple attribute key-value pairs, greatly improving data security and diversity. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 This is a project flow chart of the present invention based on the CAD three-dimensional model information attribute management plug-in; Figure 2This is a rendering of a dam body after being cut and layered according to the present invention; Figure 3 This is a schematic diagram of the operation of manually inputting a single attribute to attach it to an entity in the present invention; Figure 4 This is a schematic diagram of the operation of automatically importing custom attributes in the present invention; Figure 5 View the attribute diagram customized for the selected entity for the present invention; Figure 6 A schematic diagram of the operation of exporting selected entity information according to the present invention. DETAILED DESCRIPTION
[0023] Embodiment 1: like Figure 1 As shown, a method for adding and outputting 3D model information attributes based on CAD includes the following steps: S1, establish a large-scale engineering overall three-dimensional model in CAD, and cut the three-dimensional model into several model units as objects to which information attributes are added to form an initial construction model; S2, using .NET open source development platform, C# language and Winform to develop a plug-in module for adding custom attributes, and manually add any attributes and attribute values; S3, using the selection sort algorithm, develop a module to add attributes in batches according to the regular order preset by the model; S4, develop a module for obtaining the model's own information, and automatically batch retrieve the model's own information attributes; S5, develop a module for obtaining custom attributes of the model, retrieve custom attributes and display them in the CAD form, so as to quickly view all custom attribute information of the model and form a construction information model; S6. Use the NPOI package file to develop an export detail list module and select the attribute output detail list.
[0024] Preferably, in step S1, the model unit is a minimum construction unit model divided step by step into units, divisions, sub-items and processes.
[0025] Preferably, in step S2, any attribute and attribute value is a custom attribute, which is stored using a data extension dictionary (ExtensionDictionary) inside the CAD.
[0026] Furthermore, the extended dictionary inherits from the DBDictionary object, which is a container for storing non-graphic objects in CAD. The dictionary exists in two forms, one is stored in the database to save the data of the entire drawing, called NameDictionaries (named object dictionary), and the other is stored in the object to save the object's information data, called ExtensionDictionary (object extension dictionary). Using the data extension dictionary to store related attributes and attribute values can be saved in the DWG file of the CAD to prevent data loss.
[0027] Preferably, in step S2, when adding custom attributes, the existence of the entity's data extension dictionary is judged, and the permission upgrade function (UpgradeOpen) is performed by obtaining the entity's DBObject object to complete the entity's extension dictionary creation (CreateExtensionDictionary), and after the creation is completed, the object permissions are downgraded (DowngradeOpen).
[0028] Preferably, in step S3, the preset regular order is the order of x, y, and z coordinates of the component's center of mass in a spatial rectangular coordinate system; after selecting the x direction, y direction, or z direction method in the plug-in interface, the entities are sorted from small to large in the xyz direction through an algorithm based on the center of mass coordinates of the entity.
[0029] Preferably, in step S3, the sorting algorithm includes a CAD built-in API method, converting the entity (Entity) into a 3D entity (Solid3d) using the as keyword, reading the centroid attribute of the entity, sorting the ObjectId of the selected entity, and sorting using a selection sorting algorithm.
[0030] Furthermore, in CAD, most entities are regular, and their mass centers will not be offset outside the entity, which will not affect the coordinate components of their mass centers, so they can be sorted using this method.
[0031] Preferably, in step S3, batch adding of attributes is implemented by using a custom function AddDictionaryItem, and the specific method is as follows: Get the entity DBObject object and open its write mode (OpenMode.ForWrite); Create an Xrecord record and store the attributes into a temporary List list through key-value pairs; The values in the list are passed to the dictionary using the SetAt function, and then created into the database (AddNewlyCreatedDBObject) to complete batch attribute addition.
[0032] Preferably, in step S4, the model built-in information is the volume, area and coordinate information that comes with the model after it is established; taking the model volume as an example, the volume information of the entity is read by obtaining the ObjectId of the entity through the CAD built-in function, and is linked to its entity ID (ObjectId) to assist in the calculation of the bill of quantities.
[0033] The method to retrieve model information is: First, obtain the transaction object (Transaction) through the transaction mode of CAD, and convert the selected Object object into a readable entity (Entity) and 3D solid (Solid3D) through its function of obtaining the Object object (GetObject). Then, obtain the entity ID through the entity's ObjectId, and obtain the volume information by reading the Volume in the MassProperties attribute of the 3D solid.
[0034] Preferably, in step S5, the execution method of calling the model custom attribute module is: Use the GetDictionaryFirstString function through the built-in API method of CAD to obtain the ObjectId of the entity, and then obtain the DBObject object through the ObjectId to open the data dictionary and read the attributes; Custom attributes can be modified and deleted. To modify, pass in new attributes through the custom function SetDictionaryItem to perform replacement operations, and to delete, use the custom function DeleteKeyValue to perform deletion operations. Both of the above custom functions use the entity's DBObject to operate its data extension dictionary. The construction information model is a model that is broken down into processes based on the construction detailed design model, and its attributes are expanded and given construction information. It is used for construction management and digital delivery.
[0035] Preferably, in step S6, the detailed list is a detailed list including entity ID, custom attributes and attribute values, and entity volume attributes; the method for exporting the detailed list is: Create a detailed list through NPOI and system I / O package methods; The information read from CAD is integrated into DataTable, and then IWorkbook is created and the data is written through the method in the NPOI package. Finally, the detailed list is saved and output through the system I / O package.
[0036] Embodiment 2: A method for adding and outputting 3D model information attributes based on CAD, taking a large arch dam as an example, includes the following steps: S1. Modeling and decomposition: like Figure 2 As shown, CAD is used to establish a three-dimensional model of a large arch dam. The dam is divided into sections and layers according to the unit-division-unit (process) engineering division standard and the construction plan, and a dam is decomposed into several unit (process) engineering models.
[0037] The unit-division-unit (process) engineering division standard refers to the engineering division tree structure formed before the project starts and approved by the supervisor or owner. It is used in construction management processes such as quality inspection and evaluation. Unit and division engineering are generally determined in the design documents, and unit engineering is determined based on construction measures. It is the smallest unit of construction management.
[0038] The unit (process) engineering model is the basic object for inputting, delivering and managing construction information attributes.
[0039] S2. Develop plug-ins based on CAD information attribute input: Use C# language to write a program for adding and outputting 3D model information attributes based on Autodesk AutoCAD.
[0040] S3, Manual and automatic input information attributes: Import the model after S1 modeling and decomposition into CAD, and load the plug-in described in S2. Manually input information attributes in the plug-in is to enter the custom attribute name and attribute value in the input box in the custom attribute module, click Add to Entity, and finally select the entity in CAD to complete the attribute attachment; automatically input information attributes is to use Excel to import attributes (divided into x, y, z directions) in the custom attribute module, and select the corresponding entity to complete the automatic import.
[0041] The manual input method is to attach it to a single entity after inputting it in the text box; enter the name and value to be attached in the custom property box on the left side of the plug-in interface, then click the "Add to Entity" button, select the entity to complete the manual input information operation. The characters entered in the text box will be converted to a string type and saved in the data dictionary of the entity; like Figure 3 As shown, the automatic input method is to first select multiple entities that need to be attached with attributes in CAD, select the import method by selecting the Excel import attribute (select one of the x, y, and z directions), and then read the Excel table data, and attach the data in the table to the selected entities one by one. Table 1 is the custom attribute data imported into a certain dam section.
[0042] ; Table 1: Custom attribute data imported into a dam section; like Figure 4 As shown, S4, call the data plug-in (for example, call custom attribute data): In the custom property display module of the plug-in, by clicking the "Select Entity" button and selecting the entity you want to view in CAD, the custom properties of the entity will be displayed in the table, and the ID and volume below will also be displayed.
[0043] like Figure 5 As shown, the table displays custom attributes. If the selected entity has no custom attributes, the system will prompt that there are no attributes, but the ID and volume of the CAD entity will still be displayed; In the custom attribute display module, custom attributes can be modified and deleted; modify the attribute value in the table and then click the Modify button to modify it; select a row of attributes and click the Delete button to delete the attribute; if you select multiple entities and then click Multiple Delete, all added attributes of the selected entities can be deleted.
[0044] like Figure 6 As shown, S5, automatic output information attribute details: There is an "Export Details List" button at the bottom of the plug-in, which can rotate the model to a relatively suitable angle for selection. Then click the button to export the selected entity information to an Excel table outside the CAD to complete the export operation.
[0045] Preferably, in step S1, the sectioned CAD entities are classified into layers to facilitate subsequent management and selection operations.
[0046] ; Table 2: Data exported using the export list after a dam section is cut; The export detail table is an Excel table, and the column attributes are entity ID, entity volume, and custom attribute name and attribute value. Table 2 is the data exported using the export detail table after a dam section is cut.
Claims
1. A method for adding and outputting three-dimensional model information attributes based on CAD, characterized in that: The following steps are involved: S1, establishing an overall three-dimensional model of the project in CAD, and cutting the three-dimensional model into a number of model units as objects to which information attributes are added, to form an initial construction model; S2, manually add any attributes and attribute values by developing the add custom attribute function module of the plug-in; S3, using the selection sort algorithm, develop a module to add attributes in batches according to the regular order preset by the model; S4, develop a module for obtaining the model's own information, and automatically batch retrieve the model's own information attributes; S5, develop a module for obtaining custom attributes of the model, retrieve custom attributes and display them in the CAD form, so as to quickly view all custom attribute information of the model and form a construction information model; S6. Use the NPOI package file to develop an export detail list module and select the attribute output detail list.
2. A method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S1, the model unit is the smallest construction unit model divided step by step according to units, divisions, sub-items and processes.
3. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S2, any attribute and attribute value is a custom attribute, which is stored using the data extension dictionary inside the CAD.
4. The method for adding and outputting 3D model information attributes based on CAD according to claim 3, characterized in that: In step S2, when adding custom attributes, the existence of the entity's data extension dictionary is judged, and the permission enhancement function is performed by obtaining the entity's DBObject object to complete the creation of the entity's extension dictionary. After the creation is completed, the object permission is downgraded.
5. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S3, the preset regular order is the order of the x, y, and z coordinates of the component's centroid in the spatial rectangular coordinate system; after selecting the x direction, y direction, or z direction method in the plug-in interface, the algorithm is used to sort the entities from small to large in the xyz direction based on the centroid coordinates of the entity.
6. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S3, the sorting algorithm includes a CAD built-in API method, converting the entity into a 3D entity using the as keyword, reading the centroid attribute of the entity, sorting the ObjectId of the selected entity, and sorting using the selection sorting algorithm.
7. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S3, batch adding of attributes is implemented through a custom function. The specific method is as follows: Get the entity DBObject object and turn on its write mode; Create an Xrecord record and store the attributes into a temporary List list through key-value pairs; The values in the list are passed to the dictionary using the SetAt function, and then created into the database to complete batch attribute addition.
8. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S4, the model built-in information is the volume, area and coordinate information that comes with the model after it is established; the method for retrieving the model information is: First, obtain the transaction object through the transaction mode of CAD, and convert the selected Object object into a readable entity and 3D solid through its function of obtaining the Object object. Then, obtain the entity ID through the ObjectId of the entity, and obtain the volume information by reading the Volume in the MassProperties attribute of the 3D solid.
9. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S5, the execution method of calling the model custom attribute module is: Use the GetDictionaryFirstString function through the built-in API method of CAD to obtain the ObjectId of the entity, and then obtain the DBObject object through the ObjectId to open the data dictionary and read the attributes; Custom attributes can be modified and deleted. To modify, pass in new attributes through the custom function SetDictionaryItem to perform replacement operations, and to delete, use the custom function DeleteKeyValue to perform deletion operations. Both of the above custom functions use the entity's DBObject to operate its data extension dictionary. The construction information model is a model that is broken down into processes based on the construction detailed design model, and its attributes are expanded and given construction information. It is used for construction management and digital delivery.
10. The method for adding and outputting 3D model information attributes based on CAD according to claim 1, characterized in that: In step S6, the detailed list is a detailed list consisting of entity ID, custom attributes and attribute values, and entity volume attributes; the method for exporting the detailed list is: Create a detailed list through NPOI and system I / O package methods; The information read from CAD is integrated into DataTable, and then IWorkbook is created and the data is written through the method in the NPOI package. Finally, the detailed list is saved and output through the system I / O package.
Citation Information
Patent Citations
Data model transmission method and device between Revit and AutoCAD
CN114692238A
Concrete dam construction simulation progress dynamic visualization method based on same data source
CN116628798A
Building production information integration system
WO2003040969A1
Cited By
Loading method and device for custom entity in CAD drawing and storage medium
CN120353518A