Model product-oriented graph number and document name conversion method
Through CATIA secondary development and regular expressions, the drawing numbers and document names of model products are automatically converted, solving the problem of cumbersome and error-prone conversion process in existing technologies and achieving efficient and accurate model product data conversion.
Patent Information
- Application Number
- CN202511075575.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-01
- Publication Date
- 2025-09-30
AI Technical Summary
In the prior art, the conversion process of model product drawing numbers and document names is cumbersome, inefficient, and error-prone, making it difficult to identify and manage data of different model products.
A method combining CATIA secondary development interface and regular expression is adopted to obtain CATIA object instances through the GetObject interface, construct converted folders and root product node objects, traverse the assembly tree using the stack data structure, and automatically convert the key attributes (instance name, part number) and file names of the model products.
It improves the efficiency and accuracy of model product conversion, ensures the consistency of product nodes and file links after conversion, and reduces manual operation errors.
Smart Images

Figure CN120724504A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of computer-aided design software information processing, and in particular relates to a method for converting drawing numbers and document names for model products. Background Art
[0002] Model products usually refer to three-dimensional assembly prototypes created by designers using computer-aided design tools based on assembly requirements and usage objectives. Model products allow designers, technicians and users to accurately simulate and analyze the matching status, assembly sequence and related features of each product component. The entire life cycle of a model product includes five key links: design, manufacturing, use, maintenance and scrapping. The efficient flow of model product data is one of the key factors to ensure quality and efficiency improvement throughout the entire life cycle of the model product, especially in the early stages of design. During the data flow process of the design and manufacturing stages, for the same batch of model products, since the drawing numbers of each model product are relatively similar, it is not conducive to the identification and management of data between different model products. Some similar character parts need to be converted and set to blank, leaving the character parts that are convenient for manufacturing personnel to quickly identify different model products. There is often a need to convert special names in each product node of the model product.
[0003] Currently, due to the lack of an effective method for batch conversion of model products, designers and technicians often need to manually convert the key attributes (instance name, part number) and file names of each product node of the model product, which is inefficient and prone to errors. Summary of the Invention
[0004] In order to solve the problem that the existing technical means of handling model product conversion is cumbersome, inefficient and error-prone, the present invention proposes an efficient conversion method for drawing numbers and document information for model products, which converts the key attributes (instance name, part number) and file names of each product node of the model product, assisting manufacturing personnel to quickly identify the difference information between different models, especially in the responsible model product scenario, and improve the efficiency of model product conversion.
[0005] To achieve the above object, the technical solution of the present invention is as follows: A method for converting drawing numbers and document names for model products, comprising: Step S1: sort out all the model products to be converted, and open one of the model products with the drawing number to be converted in CATIA; Step S2: in the model product of step S1, obtain the object instance of the CATIA application running process through the GetObject interface, and obtain the current CATIA active window document object through the ActiveDocument property of the object instance; Step S3: Determine the number of conversion groups based on the characters that actually need to be converted in the current model product, input the number of groups to be converted, and determine whether the input number of groups is 0. If it is 0, exit the implementation process to end; if not, go to step S4; Step S4, input the transformation names corresponding to the groups in step S4 using spaces as separators, and integrate the input transformation names into a regular pattern; Step S5: Using the active window document object in step S2 and the regular pattern in step S4 as data basis, construct a file of a converted folder and a converted root product node object; Step S6: close the active form document object in step S3, and open the file of the transformed root product node object to obtain the transformed root product node object; Step S7: Using the transformed root product node object as a reference, obtain a collection container containing all product items on the assembly tree through the stack data structure; Step S8: Based on the regular pattern described in step S4 and the collection container described in step S7, construct the converted files of each product item, and convert the instance name and part number of each product item through CATIA secondary development; Step S9: traverse the collection container in step S7 and save all modified product items.
[0006] Step S10: Open the next model product to be converted in CATIA, and repeat steps S2-S9 to complete the conversion of all model products to be converted.
[0007] Furthermore, in step S4, the conversion name corresponding to the group number in step S4 is input with a space as a separator, and its representation is as follows:
[0008] Wherein, SCi represents the i-th conversion name, the range of i is {1, n}, and n represents the number of groups to be converted input in step S4.
[0009] In step S4, the input conversion name is integrated into a regular pattern, and the implementation steps include the following: S4a, taking a space delimiter as input, splits the input transformation name using the Split method of the input transformation name to obtain an array object containing all transformation names; S4b, taking the array object containing all the conversion names and the pipe delimiter described in step S5a as input, concatenates the array objects using the Join method to obtain a regular pattern for subsequent conversion regularization processing, which is represented as follows:
[0010] Wherein, SCi represents the i-th conversion name, the range of i is {1, n}, and n represents the number of groups to be converted input in step S4.
[0011] Furthermore, in step S5, the converted folder and the converted root product node object file are constructed, and the implementation steps include the following: S5a, acquiring the root product object on the model product assembly tree through the Product attribute of the active window document object in step S2 to obtain the root node product object; S5b, using the ReferenceProduct.Parent.FullName property of the root node product object in step S5a to obtain the absolute location of the root node product object in the resource manager, obtaining the absolute path information, and further using the GetDirectoryName interface and GetFileName interface to obtain the parent directory path and folder name of the absolute path information, respectively, to obtain the absolute path and folder name of the document directory where the model product is located; S5c, using the folder name where the model product is located in step S5b and the regular pattern in step S5b as input, converting the folder name using a regular expression to obtain a converted folder name, concatenating the absolute path of the document directory where the model product is located in step S5b with the converted folder name using the Combine interface to obtain an absolute path of the converted document directory, and constructing the converted folder using the CreateFolder interface to form a converted folder; S5d, obtaining the document name of the root node product object through the ReferenceProduct.Parent.Name attribute of the root node product object in step S5a to obtain the document name of the root node product object before conversion; S5e, taking the document name of the root node product object before conversion in step S5d and the regular pattern in step S4b as input, uses regular expressions to convert the document name to obtain the document name of the root node product object after conversion, and splices it with the absolute path of the converted document directory in step S5c through the Combine interface to obtain the absolute path of the root node product object after conversion, and uses it as input to save the file of the current root node product object through the SaveAs method of the active window document object in step S2 to form the file of the root product node object after conversion.
[0012] Furthermore, in step S6, the active form document object in step S3 is closed, and the file of the converted root product node object is opened. The implementation steps include the following: S6a, closing the active window document object through the Close method of the active window document object in step S3; S6b, taking the absolute path of the converted root node product object in step S5e as input, open the converted model product root node product through the Documents.Open method of the object instance in step S2 to obtain the converted window document object.
[0013] Furthermore, in step S7, based on the transformed root product node object, a collection container containing all product items on the assembly tree is obtained through the stack data structure. The implementation steps include the following: S7a, create a collection container for collecting all product objects; S7b, creating a stack data structure and pushing the transformed root node product object described in step S6b into the stack; S7c, determine whether the Count attribute of the stack is greater than 0. If so, repeat steps S7d and S7f until the Count attribute of the stack is 0, completing the collection of all product items on the assembly tree; S7d, pop the top product item from the stack to obtain the currently processed product item, and add it to the collection container described in step S7a; S7f, obtaining the sub-product item node set through the Products attribute of the currently processed product item in step S7d, traversing all product items in the sub-product item node set and pushing them into the stack described in step S7b.
[0014] Furthermore, in step S8, the converted files of each product item are constructed, and the instance names and part numbers of each product item are converted through CATIA secondary development. The implementation steps include the following: S8a, traverse all product items in the collection container described in step S7a, and determine whether they are top-level node objects. If so, skip processing the current product item. If not, obtain the document name of the current product item object through the product item ReferenceProduct.Parent.Name property to obtain the document name corresponding to the product item, and use it and the regular pattern described in step S4b as input. Use regular expressions to transform the document name to obtain the transformed document name, and use the Combine interface to splice it with the absolute path of the converted document directory described in step S5c. Use the spliced absolute path as input, and determine whether the spliced absolute path exists in the resource manager by checking whether the Dir method result is empty. If it is empty, it means it does not exist. Use the product item ReferenceProduct.Parent.SaveAs method with the spliced absolute path as input to construct the converted document of the product item; S8b, traversing the collection container described in step S7a to obtain each traversed product object item; S8c, determining whether the current product object item described in S8b is a top-level node object. If so, obtaining the corresponding part number using the PartNumber attribute of the current product object item and combining it with the regular pattern described in step S4b as input, and converting the top-level node part number using a regular expression. If not, obtaining the instance name and part number of the current product object item using the Name and PartNumber attributes of the current product object item, and using the obtained instance name and part number as input, converting the obtained instance name and part number using a regular expression to obtain the converted instance name and part number. S8d, obtain the document object of the parent product item of the current product object item through the Parent.Parent.ReferenceProduct.Parent property of the current product object item described in S8b, and obtain the instance name of the current product object item through the Name property of the current product item. Taking the obtained instance name of the current product object item as input, obtain the instance object of the current product object item through the Product.Products.Item method of the document object of the aforementioned parent product item.
[0015] S8e, attaching the instance name and part number converted in step S8c to the instance object Name and PartNumber attributes of the current product object item in step S8d, respectively, to achieve conversion of the instance name and part number of the current product object item; S8f, repeating steps S8c to S8e to process all traversed items in step S8b until the conversion of instance names and part numbers for all product nodes on the model product assembly tree is completed.
[0016] Furthermore, in step S9, the collection container of step S7 is traversed to save all modified product items. The implementation steps include the following: S9a, traversing all product items in the collection container described in step S7a; S9b, determining whether the ReferenceProduct.Parent.Saved property of the current product item is False. If the value is False, it indicates that the document object of the current product item has been modified. The document object is saved by using the ReferenceProduct.Parent.Save method of the current product item. S9c, repeat step S9b until all modified product items are saved.
[0017] Furthermore, in steps S5c, S5e, S8a and S8c, the original content item is transformed using regular expressions, which take the original content, the regular pattern described in step S4b and the empty string as input, and transform the original content item through the Replace method of the Regex object.
[0018] Furthermore, in step S8a and step S8c, it is determined whether the current product object is a top-level node object. The parent-level object name information of the current product object is obtained through the Parent.Parent.Name of the current product object. When the value of the parent-level object name information is "CNEXT", the current product node is considered to be a top-level node object.
[0019] The beneficial effects of the present invention are at least: First, after the model product is converted, the product nodes and file links are consistent.
[0020] The method described in the present invention is based on the root product node of the model product, uses regular expression character processing technology as a means, and combines the file system interface and the CATIA secondary development interface to realize the construction of files corresponding to all converted products, thereby ensuring the unification of the internal product nodes and the corresponding external file links after the model product conversion with high quality and efficiency, and improving the consistency of the file links after the conversion processing.
[0021] Second, the model product conversion efficiency and accuracy are high.
[0022] The method of the present invention takes the instance objects of each product item on the model product assembly tree as the benchmark and converts the key attributes (instance name and part number) and reference files of each product item based on the CATIA secondary development interface, ensuring that all product items on the assembly tree are processed accurately and efficiently, thereby improving the efficiency and accuracy of model product conversion. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 Flow chart of the method of the present invention; Figure 2 The document directory before conversion of the model product of the embodiment of the present invention; Figure 3 The assembly tree before the conversion of the model product of the embodiment of the present invention; Figure 4 A document directory after the converted document is constructed for the embodiment of the present invention; Figure 5 This is the assembly tree after the model product is converted according to the embodiment of the present invention. DETAILED DESCRIPTION
[0024] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0025] Reference Figure 1 The embodiment of the present invention provides a method for converting drawing numbers and document names for model products, comprising the following steps: Step 1: Organize and open the model product to be converted in CATIA.
[0026] 1.1) The present invention adopts Figure 2 The model products to be converted corresponding to the document directory shown are taken as examples.
[0027] 1.2) Open the model product to be converted in step 1.1) in CATIA software. The corresponding assembly tree is as follows: Figure 3 shown.
[0028] Step 2, obtain the CATIA process object and active window document object.
[0029] 2.1) Get the object instance of the CATIA application running process through the GetObject interface.
[0030] 2.2) Obtain the current CATIA active window document object through the activeDocument attribute of the object instance described in step S2.
[0031] Step 3: In this embodiment, the model product needs to be converted into two groups, which are input and the conversion names are ST and LX respectively.
[0032] Step 4: Enter the transformation name corresponding to the number of groups and construct a regular pattern for subsequent transformation regularization processing.
[0033] 4.1) Input the transformation names corresponding to the transformation groups described in step 3 with spaces as separators, i.e., ST LX. Split the input transformation names using the Split method to obtain an array object containing all transformation names.
[0034] 4.2) Using the array object containing all transformation names and the pipe delimiter described in 4.1) as input, concatenate the array objects using the Join method to obtain the regular pattern for subsequent transformation regularization processing, namely ST|LX.
[0035] Step 5: Build the converted folder and construct the file of the converted root product node object.
[0036] 5.1) Obtain the root product object on the model product assembly tree through the Product attribute of the active window document object described in 2.2) to obtain the root node product object ( Figure 3 (Product item corresponding to TEST-LX-0001 in the table).
[0037] 5.2) Use the ReferenceProduct.Parent.FullName property of the root node product object described in 5.1) to obtain the absolute location of the root node product object in the resource manager (D:\ TEST-LX-0001\ TEST-LX-0001.CATProduct) to obtain the absolute path information. Further, use the GetDirectoryName interface and GetFileName interface to obtain the parent directory path and folder name of the absolute path information respectively, and obtain the absolute path of the document directory where the model product is located (D:\ TEST-LX-0001) and the folder name (TEST-LX-0001).
[0038] 5.3) Using the folder name of the model product described in 5.2) and the regular pattern described in step S5 as input, transform the folder name using the Replace method of the Regex object to obtain a transformed folder name (TE--0001). Using the Combine interface, concatenate the absolute path of the document directory where the model product described in step S7 and the transformed folder name to obtain an absolute path of the transformed document directory (D:\ TEST-LX-0001\ TE--0001). Use the CreateFolder interface to construct the transformed folder to form a transformed folder.
[0039] 5.4) Obtain the document name of the root node product object through the ReferenceProduct.Parent.Name property of the root node product object described in 5.1) to obtain the document name of the root node product object before conversion (TEST-LX-0001.CATProduct).
[0040] 5.5) Using the document name of the root node product object before conversion described in 5.4) and the regular pattern described in step S5 as input, the Replace method of the Regex object is used for conversion to obtain the document name of the root node product object after conversion (TE--0001.CATProduct). This is concatenated with the absolute path of the converted document directory described in step S8 through the Combine interface to obtain the absolute path of the root node product object after conversion (D:\TEST-LX-0001\TE—0001\TE--0001.CATProduct). This is used as input to save the file of the current root node product object through the SaveAs method of the active window document object described in step S3 to form the file of the converted root product node object.
[0041] Step 6: Close the active form document object and open the file of the converted root product node object.
[0042] 6.1) Close the active window document object through the Close method of the active window document object described in 2.2).
[0043] 6.2) Using the absolute path of the converted root node product object described in 5.5) as input, open the converted model product root node product through the Documents.Open method of the object instance described in 2.1) to obtain the converted window document object.
[0044] Step 7: Get a collection container containing all product items on the model product assembly tree.
[0045] 7.1) Create a collection container to collect all product objects.
[0046] 7.2) Create a stack data structure and push the transformed root node product object described in 6.2) onto the stack.
[0047] 7.3) Determine whether the stack's Count property is greater than 0. If so, repeat 7.4) and 7.5) until the stack's Count is 0, completing the collection of all product items on the assembly tree.
[0048] 7.4) Pop the top product item from the stack, get the currently processed product item, and add it to the collection container described in step 7.1).
[0049] 7.5) Obtain the sub-product item node collection of the currently processed product item through the Products property of 7.4), traverse all product items in the sub-product item node collection and push them into the stack described in 7.1).
[0050] Step 8: Build the converted files of each product item on the assembly tree.
[0051] 8.1) Traverse all product items in the collection container described in step 7, and obtain the instance name and part number of the current traversed product item through its Name and PartNumber properties. If the instance name and part number are consistent, they are represented as the top-level node object and the processing of the current product item is skipped. If they are inconsistent, go to 8.2).
[0052] 8.2) Get the document name of the current product item object in 8.1) through the product item ReferenceProduct.Parent.Name property to obtain the document name corresponding to the product item, and use it with the regular pattern described in 4.2) as input. Use the Replace method of the Regex object to transform the document name to obtain the transformed document name, and use the Combine interface to splice it with the absolute path of the transformed document directory described in 5.3) to determine whether the spliced absolute path already exists in the resource manager. If not, use the product item ReferenceProduct.Parent.SaveAs method with the spliced absolute path as input to construct the transformed document of the product item. The detailed information of all product object items before and after the transformation of each traversal item is shown in Table 1. The document directory after the transformed document is constructed is shown in Figure 4 shown.
[0053] Table 1 List of absolute paths of product object documents before and after conversion of each traversed product item
[0054] In the above table, BDF is the absolute path of D:\ TEST-LX-0001, and ADF is the absolute path of D:\ TEST-LX-0001\ TE- -0001.
[0055] Step 9: Convert the instance names and part numbers of all product items on the model product assembly tree.
[0056] 9.1) Traverse all product items in the collection container described in step 7, and obtain the instance name and part number of the current traversed product item through its Name and PartNumber properties. If the instance name and part number are consistent, they are represented as the top-level node object and the processing of the current product item is skipped. If they are inconsistent, go to 9.2).
[0057] 9.2) Obtain the corresponding part number through the PartNumber attribute of the product item. Combine this with the regular pattern described in step S5 as input and use the regular expression to transform the top-level node part number. If not, obtain the instance name and part number of the current product item through the Name and PartNumber attributes of the current product item. Using the obtained instance name and part number as input, use the Replace method of the Regex object to transform the obtained instance name and part number to obtain the transformed instance name and part number. The comparison of the instance name and part number before and after the transformation of each traversed product item is shown in Table 2.
[0058] Table 2 Comparison of instance names and part numbers before and after conversion of each traversed product item
[0059] 9.3) Get the document object of the parent product item of the current product item through the Parent.Parent.ReferenceProduct.Parent property of the current product item, get the instance name of the current product item through the Name property of the current product item, use the instance name of the current product item as input, and use the Product.Products.Item method of the document object of the parent product item of the current product item to obtain the instance object of the current product item. Attach the instance name and part number converted in 9.2) to the Name and PartNumber properties of the current product item instance object respectively to convert the model product instance name and part number. The converted model product assembly tree is as follows: Figure 5 shown.
[0060] Step 10: Save all modified product items on the model product assembly tree.
[0061] 10.1) Traverse all product items in the collection container described in step 7, and determine whether the ReferenceProduct.Parent.Saved property of the current product item is False. If it is False, it means that the current product item document object has been modified, and go to 10.1).
[0062] 10.2) Save the document object through the ReferenceProduct.Parent.Save method of the current product item.
Claims
1. A method for converting drawing numbers and document names for model products, characterized in that: include: S1. Obtain all model products to be converted, and open one of the model products with the drawing number to be converted in CATIA; S2. Obtain the object instance of the CATIA application running process through the GetObject interface, and obtain the current CATIA active window document object through the ActiveDocument property of the object instance; S3. Determine the number of conversion groups based on the characters that actually need to be converted in the current model product, input the number of groups to be converted, and determine whether the input number of groups is 0. If it is 0, exit the implementation process. If not, go to S4. S4. Enter the conversion names corresponding to the number of groups using spaces as separators, and integrate the conversion names into a regular pattern; S5. Using the active window document object described in S2 and the regular pattern described in S4 as data basis, construct files of the converted folder and the root product node object; S6. Close the active window document object, and open the file of the converted root product node object to obtain the converted root product node object; S7, using the converted root product node object as a reference, obtaining a collection container containing all product items on the assembly tree through the stack data structure; S8. Based on the regular pattern described in S4 and the collection container described in S7, construct the converted files of each product item, and convert the instance name and part number of each product item through CATIA secondary development; Step S9, traverse the S7 collection container and save all modified product items; Step S10: Open the next model product to be converted in CATIA, and repeat S2 to S9 to complete the conversion of all model products to be converted.
2. The method according to claim 1, characterized in that In S4, the conversion names corresponding to the number of input groups are separated by spaces, and the representation is as follows: Where SCi represents the name of the i-th conversion, the range of i is {1, n}, and n represents the number of groups to be converted; S4 integrates the conversion names into regular patterns, including: S4a, taking a space delimiter as input, splits the input transformation name by the Split method of the input transformation name to obtain an array object containing all transformation names; S4b takes an array object containing all transformation names and a pipe separator as input, concatenates the array objects using the Join method, and obtains a regular pattern for subsequent transformation regularization processing, which is represented as follows: 。 3. The method according to claim 2, characterized in that The files used to construct the converted folder and root product node object in S5 include: S5a, acquiring the root product object on the model product assembly tree through the Product attribute of the active window document object in S2 to obtain the root node product object; S5b, obtains the absolute location of the root node product object in the resource manager through the ReferenceProduct.Parent.FullName property of the root node product object in S5a, obtains the absolute path information, and further obtains the parent directory path and folder name of the absolute path information through the GetDirectoryName interface and the GetFileName interface, respectively, to obtain the absolute path and folder name of the document directory where the model product is located; S5c, using the folder name where the model product described in S5b is located and the regular pattern described in step S4b as input, converts the folder name using a regular expression to obtain a converted folder name, concatenates the absolute path of the document directory where the model product described in S5b is located with the converted folder name using the Combine interface to obtain the absolute path of the converted document directory, and uses the CreateFolder interface to construct the converted folder to form a converted folder; S5d, obtaining the document name of the root node product object through the ReferenceProduct.Parent.Name property of the root node product object described in S5a, and obtaining the document name of the root node product object before conversion; S5e, takes the document name of the root node product object before conversion described in S5d and the regular pattern described in step S4b as input, uses regular expressions to convert the document name to obtain the document name of the root node product object after conversion, splices it with the absolute path of the converted document directory described in step S5c through the Combine interface, obtains the absolute path of the root node product object after conversion, uses it as input, and saves the file of the current root node product object through the SaveAs method of the active window document object described in S2 to form the file of the root product node object after conversion.
4. The method according to claim 3, characterized in that In S6, the active window document object is closed, and the file of the converted root product node object is opened, which specifically includes: S6a, closing the active window document object through the Close method of the active window document object; S6b, taking the absolute path of the converted root node product object in S5e as input, open the converted model product root node product through the Documents.Open method of the object instance to obtain the converted window document object.
5. The method according to claim 4, characterized in that In step S7, based on the converted root product node object, a collection container containing all product items on the assembly tree is obtained through the stack data structure, specifically including: S7a, create a collection container for collecting all product objects; S7b, creating a stack data structure and pushing the converted root node product object described in S6b into the stack; S7c, determines whether the Count attribute of the stack is greater than 0. If so, repeatedly executes S7d and S7f until the Count attribute of the stack is 0, completing the collection of all product items on the assembly tree; S7d, pop the top product item of the stack to obtain the currently processed product item, and add it to the collection container described in S7a; S7f, obtains its child product item node set through the Products attribute of the product item currently processed in S7d, traverses all product items in the child product item node set and pushes them into the stack described in S7b.
6. The method according to claim 5, characterized in that In S8, the converted files of each product item are constructed, and the instance names and part numbers of each product item are converted through CATIA secondary development, including: S8a, traverses all product items in the collection container described in S7a, and determines whether they are top-level node objects. If so, skip processing the current product item; if not, obtain the document name of the current product item object through the product item ReferenceProduct.Parent.Name property, obtain the document name corresponding to the product item, and use it and the regular pattern described in S4b as input. Use regular expressions to convert the document name to obtain the converted document name, and use the Combine interface to splice it with the absolute path of the converted document directory described in S5c. Use the spliced absolute path as input, and determine whether the spliced absolute path exists in the resource manager by judging whether the result of the Dir method is empty. If it is empty, it means it does not exist. Use the product item ReferenceProduct.Parent.SaveAs method and the spliced absolute path as input to construct the converted document of the product item; S8b, traverse the collection container described in S7a to obtain each traversed product object item; S8c, determining whether the current product object item in S8b is a top-level node object; if so, obtaining the corresponding part number through the PartNumber attribute of the current product object item, combining it with the regular pattern described in S4b as input, and converting the top-level node part number using a regular expression; if not, obtaining the instance name and part number of the current product object item through the Name and PartNumber attributes of the current product object item, using the obtained instance name and part number as input, and converting the obtained instance name and part number using a regular expression to obtain the converted instance name and part number; S8d, obtaining the document object of the parent product item of the current product item through the Parent.Parent.ReferenceProduct.Parent property of the current product item in S8b, and obtaining the instance name of the current product item through the Name property of the current product item, and using the obtained instance name of the current product item as input, obtaining the instance object of the current product item through the Product.Products.Item method of the document object of the parent product item; S8e, attaching the instance name and part number converted in S8c to the instance object Name and PartNumber attributes of the current product object item in S8d, respectively, to achieve conversion of the instance name and part number of the current product object item; S8f, repeat S8c~S8e to process all traversal items in S8b until the conversion of instance name and part number of all product nodes on the model product assembly tree is completed.
7. The method according to claim 6, characterized in that In S9, the S7 collection container is traversed to save all modified product items, including: S9a, traversing all product items of the collection container described in S7a; S9b, determining whether the ReferenceProduct.Parent.Saved property of the current product item is False. If the value is False, it is determined that the document object of the current product item has been modified, and the document object is saved by the ReferenceProduct.Parent.Save method of the current product item. S9c, repeat S9b until all modified product items are saved.
8. The method according to claim 6, characterized in that In S5c, S5e, S8a and S8c, regular expressions are used to transform the original content items. The original content, the S4b regular pattern and the empty string are used as input, and the original content items are transformed through the Replace method of the Regex object.
9. The method according to claim 6, characterized in that In S8a and S8c, it is determined whether the current product object is a top-level node object. The parent-level object name information of the current product object is obtained through the Parent.Parent.Name of the current product object. When the value of the parent-level object name information is "CNEXT", it is determined that the current product node is a top-level node object.
