A decryption and processing method, system, device and medium for Revit family files
By monitoring user editing type operations and requesting encrypted data from the intranet server, the encryption vacancies and high time cost problems in Revit family file protection are solved, and the automatic rewrite type editing dialog box and data security are improved.
Patent Information
- Application Number
- CN202411196227.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-29
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-08-29
AI Technical Summary
The existing Revit family file protection scheme has problems such as cryptographic failure and high time cost, especially when multiple family instances exist in the project environment, the decryption and processing process is significant.
By registering the SelectionChanged event and the DialogBoxShowing event, determine whether the user opens the Type Attribute dialog box. If it is an encryption family, close the native Type Attribute dialog box, obtain the encryption identifier value and request the intranet server to confuse the data corresponding to the original parameters, and open the rewritten Type Edit dialog box, replaces the obfuscated parameter name with the original parameter name, and removes the parameters generated by diffusion.
Automatic rewriting of the edit type dialog box is realized, reducing user time costs, improving data security, avoiding the steps of opening and loading the family environment during use, and simplifying user operations.
Smart Images

Figure CN118709208B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of Revit family files, and in particular to a decryption and processing method, system, device and medium for Revit family files. Background Art
[0002] Revit is a widely used 3D modeling software with good scalability and rich interfaces. The models built using this software are mainly composed of system families and loadable families. System families need to rely on the project environment, while loadable families can exist as independent files and can be applied to different projects, giving full play to the advantages of Revit parametric modeling.
[0003] In order to build loadable families with complex shapes and their parameterization, modelers need to spend a lot of time and energy. In the process of project file transmission, these unprotected families will also be spread, resulting in damage to the intellectual labor results (families) of the original creators. For this reason, it is necessary to take certain protection measures for family files. At the same time, corresponding decryption and processing methods are also required so that legitimate users can use family files normally.
[0004] Regarding the issue of family file protection, related research mainly starts with replacing family parameters, replacing family parameters with uneditable and invisible shared parameters. However, the function of hiding parameters by adding shared parameters is only valid in the project environment, but not in the family environment. In addition, storing parameters and their corresponding associated information in DataStorage will result in each modification of family parameters requiring the steps of opening the family environment, modifying family parameters, and loading the project environment. In the above steps, the time cost of opening the family environment and loading the project environment is unacceptable even if it is completed automatically by the program. Especially when there are multiple family instances in the project environment, the additional cost of program operation will be in minutes, and the time consumption is dozens or hundreds of times that of the native method.
[0005] In summary, existing solutions have problems such as easy encryption failure and high time cost. Summary of the invention
[0006] In view of this, the present invention provides a decryption and processing method, system, device and medium for Revit family files.
[0007] The present invention discloses a decryption and processing method for Revit family files, which comprises:
[0008] Register SelectionChanged event and DialogBoxShowing event to determine whether the user opens the type properties dialog box; if the user opens the type properties dialog box, determine whether the currently selected family instance is an encrypted family; if the currently selected family instance is an encrypted family, close the native type properties dialog box; obtain the identification value of the encrypted identification parameter in the encrypted family, and request the corresponding data of the obfuscated parameters and the original parameters from the intranet server through the identification value; open the rewritten type editing dialog box, replace the obfuscated parameter name with the original parameter name, and remove the parameters generated by diffusion.
[0009] Furthermore, the DialogId property of DialogBoxShowingEventArgs is used to determine whether the user opens the type property dialog box; the GetSelectedElements() method of SelectionChangedEventArgs is used to obtain the currently selected family instance; and the LookupParameter() method is used to obtain the identification value of the encrypted identification parameter in the encrypted family.
[0010] Further, the requesting the intranet server for data corresponding to the obfuscated parameters and the original parameters through the identification value includes:
[0011] The user sends a request to the server, and the server receives the request sent by the user. The server determines whether the received request is for intranet access. If it is for intranet access, the identification value is used as the query condition, and a database query is executed to query the corresponding table in the database to obtain the obfuscated parameters and original parameter lists that match the identification value. After the database query is completed, the server encapsulates the query results into response data; the server sends an HTTP response and returns the query results to the user; wherein the query results are the obfuscated parameters and the original parameters.
[0012] Furthermore, the user sends a request to the server, including:
[0013] The user initiates an HTTP POST request through the client plug-in function and sends a request containing an identification value to the server.
[0014] Furthermore, the server receives a request sent by a user, including:
[0015] After receiving the HTTP POST request, the server extracts the X-Forwarded-For field from the request header to obtain the client's IP address; at the same time, the server parses the identification value in the request body.
[0016] Furthermore, the server determines whether the received request is for intranet access, including:
[0017] The server uses the intranet IP address range to determine whether the IP address extracted from the X-Forwarded-For field belongs to the intranet address range; if the IP address belongs to the intranet range, it continues to process the request; otherwise, it returns an error response to prompt the user that the request is illegal.
[0018] Furthermore, if the user does not open the type properties dialog box, no operation is performed; if the currently selected family instance is not an encrypted family, no operation is performed.
[0019] The present invention also discloses a decryption and processing system for Revit family files, which is used to implement any of the above-mentioned decryption and processing methods for Revit family files, and comprises:
[0020] The judgment module is used to register the SelectionChanged event and the DialogBoxShowing event to judge whether the user opens the type property dialog box; if the user opens the type property dialog box, it is judged whether the currently selected family instance is an encrypted family; if the currently selected family instance is an encrypted family, the native type property dialog box is closed;
[0021] The processing module obtains the identification value of the encryption identification parameter in the encryption family, and requests the corresponding data of the obfuscated parameters and the original parameters from the intranet server through the identification value; opens the rewritten type editing dialog box, replaces the obfuscated parameter name with the original parameter name, and removes the parameters generated by diffusion.
[0022] The present invention also discloses a computer device, comprising: a processor and a memory for storing executable instructions of the processor; wherein the processor is used to execute the executable instructions to implement a decryption and processing method for Revit family files as described in any one of the above items.
[0023] The present invention also discloses a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the decryption and processing method for Revit family files described in any one of the above items is implemented.
[0024] Due to the adoption of the above technical solution, the present invention has the following advantages:
[0025] 1. The present invention uses events to monitor user edit type operations, thereby realizing automatic rewriting of edit type dialog boxes without changing user habits and without adding additional user operations, which is conducive to user acceptance and use.
[0026] 2. The present invention separates the encrypted data from the family file itself, which can avoid opening and loading the family file itself when in use, thereby effectively reducing the user's time cost.
[0027] 3. The present invention obtains encrypted data by accessing the intranet server, thereby improving data security and protecting the intellectual labor results of the original creator.
[0028] 4. The encrypted data is stored in the intranet server, so when using it, there is no need to go through the steps of opening the family environment and loading the project, which avoids increasing the user's time cost and makes this method more easily accepted by users. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.
[0030] Figure 1 The present invention is a flowchart of a method for decrypting and processing Revit family files according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] The present invention is further described in conjunction with the accompanying drawings and embodiments, and the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field should fall within the scope of protection of the embodiments of the present invention.
[0032] See also Figure 1 The present invention provides an embodiment of a method for decrypting and processing a Revit family file, which includes:
[0033] Register for SelectionChanged (selection change event, subscribe to this event to receive notification after the selection changes) event and DialogBoxShowing (dialog box display event, subscribe to this event to get notification when Revit is about to display a dialog box or message box) event to determine whether the user opens the type properties dialog box; if the user opens the type properties dialog box, determine whether the currently selected family instance (the element created in the Revit project environment) is an encrypted family; if the currently selected family instance is an encrypted family, close the native type properties dialog box; obtain the identification value of the encrypted identification parameter in the encrypted family, and request the corresponding data of the obfuscated parameters and the original parameters from the intranet server through the identification value; open the rewritten type editing dialog box, replace the obfuscated parameter name with the original parameter name, and remove the parameters generated by diffusion.
[0034] In one embodiment, the DialogId (a unique string identifier for dialog boxes and task dialog boxes in Revit) property of DialogBoxShowingEventArgs (a base class of event parameters used by dialog box display events, which can be used to close a dialog box or obtain a unique string identifier for a dialog box, etc.) is used to determine whether the user has opened a type property dialog box; the GetSelectedElements() method of SelectionChangedEventArgs (an event parameter for a selection change event) is used to obtain the currently selected family instance; LookupParameter() is used to obtain the identifier value of an encrypted identifier parameter in an encrypted family. GetSelectedElements() and LookupParameter() are both methods provided by RevitAPI, which is an interface provided by Revit software for secondary development of Revit.
[0035] In one embodiment, requesting the intranet server for data corresponding to the obfuscated parameters and the original parameters through the identification value includes:
[0036] The user sends a request to the server, and the server receives the request sent by the user. The server determines whether the received request is for intranet access. If it is for intranet access, the identification value is used as the query condition, and a database query is executed to query the corresponding table in the database to obtain the obfuscated parameters and original parameter lists that match the identification value. After the database query is completed, the server encapsulates the query results into response data; the server sends an HTTP response and returns the query results to the user; wherein the query results are the obfuscated parameters and the original parameters.
[0037] In one embodiment, the user sends a request to the server, including:
[0038] The user initiates an HTTP POST request through the client plug-in function and sends a request containing an identification value to the server.
[0039] In one embodiment, the server receives a request sent by a user, including:
[0040] After receiving the HTTP POST request, the server extracts the X-Forwarded-For field from the request header to obtain the client's IP address. At the same time, the server parses the identification value in the request body. X-Forwarded-For is an HTTP header field that contains the original client's IP address chain.
[0041] In one embodiment, the server determines whether the received request is for intranet access, including:
[0042] The server uses the intranet IP address range to determine whether the IP address extracted from the X-Forwarded-For field belongs to the intranet address range; if the IP address belongs to the intranet range, it continues to process the request; otherwise, it returns an error response to prompt the user that the request is illegal. X-Forwarded-For is an HTTP header field that contains the IP address chain of the original client.
[0043] In one embodiment, if the user does not open the type property dialog box, no operation is performed; if the currently selected family instance is not an encrypted family, no operation is performed.
[0044] The present invention also provides an embodiment of a decryption and processing system for Revit family files, which is used to implement a decryption and processing method for Revit family files described in the above embodiment, and includes:
[0045] The judgment module is used to register the SelectionChanged event and the DialogBoxShowing event to judge whether the user opens the type property dialog box; if the user opens the type property dialog box, it is judged whether the currently selected family instance is an encrypted family; if the currently selected family instance is an encrypted family, the native type property dialog box is closed;
[0046] The processing module obtains the identification value of the encryption identification parameter in the encryption family, and requests the corresponding data of the obfuscated parameters and the original parameters from the intranet server through the identification value; opens the rewritten type editing dialog box, replaces the obfuscated parameter name with the original parameter name, and removes the parameters generated by diffusion.
[0047] The present invention also provides an embodiment of a computer device, which includes: a processor and a memory for storing executable instructions of the processor; wherein the processor is used to execute the executable instructions to implement a decryption and processing method for Revit family files described in the above embodiment.
[0048] The present invention also provides an embodiment of a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the decryption and processing method for Revit family files described in the above embodiment is implemented.
[0049] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A method for decrypting and processing Revit family files, characterized in that: include: Register SelectionChanged event and DialogBoxShowing event to determine whether the user opens the type properties dialog box; if the user opens the type properties dialog box, determine whether the currently selected family instance is an encrypted family; if the currently selected family instance is an encrypted family, close the native type properties dialog box; obtain the identification value of the encrypted identification parameter in the encrypted family, and request the corresponding data of the obfuscated parameters and the original parameters from the intranet server through the identification value; open the rewritten type editing dialog box, replace the obfuscated parameter name with the original parameter name, and remove the parameters generated by diffusion; The method of requesting the intranet server for data corresponding to the obfuscated parameters and the original parameters through the identification value includes: The user sends a request to the server, and the server receives the request sent by the user. The server determines whether the received request is for intranet access. If it is for intranet access, the identification value is used as the query condition, and a database query is executed to query the corresponding table in the database to obtain the obfuscated parameters and original parameter lists that match the identification value. After the database query is completed, the server encapsulates the query results into response data; the server sends an HTTP response and returns the query results to the user; wherein the query results are the obfuscated parameters and the original parameters.
2. A decryption and processing method for Revit family files according to claim 1, characterized in that: Use the DialogId property of DialogBoxShowingEventArgs to determine whether the user has opened the type properties dialog box; use the GetSelectedElements() method of SelectionChangedEventArgs to obtain the currently selected family instance; use the LookupParameter() method to obtain the identification value of the encrypted identification parameter in the encrypted family.
3. A decryption and processing method for Revit family files according to claim 1, characterized in that: The user sends a request to the server, including: The user initiates an HTTP POST request through the client plug-in function and sends a request containing an identification value to the server.
4. A decryption and processing method for Revit family files according to claim 1, characterized in that: The server receives a request sent by a user, including: After receiving the HTTP POST request, the server extracts the X-Forwarded-For field from the request header to obtain the client's IP address; at the same time, the server parses the identification value in the request body.
5. A decryption and processing method for Revit family files according to claim 3, characterized in that: The server determines whether the received request is for intranet access, including: The server uses the intranet IP address range to determine whether the IP address extracted from the X-Forwarded-For field belongs to the intranet address range; if the IP address belongs to the intranet range, it continues to process the request; otherwise, it returns an error response to prompt the user that the request is illegal.
6. A decryption and processing method for Revit family files according to claim 1, characterized in that: If the user has not opened the type properties dialog box, no action will be taken; if the currently selected family instance is not an encrypted family, no action will be taken.
7. A decryption and processing system for Revit family files, used to implement a decryption and processing method for Revit family files as described in any one of claims 1 to 6, characterized in that: include: The judgment module is used to register the SelectionChanged event and the DialogBoxShowing event to judge whether the user opens the type property dialog box; if the user opens the type property dialog box, it is judged whether the currently selected family instance is an encrypted family; if the currently selected family instance is an encrypted family, the native type property dialog box is closed; The processing module obtains the identification value of the encryption identification parameter in the encryption family, and requests the corresponding data of the obfuscated parameters and the original parameters from the intranet server through the identification value; Open the rewritten type editing dialog, replace the obfuscated parameter names with the original parameter names, and remove the parameters generated by diffusion.
8. A computer device, characterized in that: include: A processor and a memory for storing executable instructions of the processor; wherein the processor is used to execute the executable instructions to implement a decryption and processing method for Revit family files as described in any one of claims 1-6.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method for decrypting and processing Revit family files according to any one of claims 1 to 6 is implemented.
