Cad-based Lisp program loop execution method, equipment and medium

By using timers and program result judgment in AutoDesk CAD software, the secondary development limitations caused by asynchronous execution of Lisp programs are solved, and the layers are quickly traversed in CAD and Lisp commands are executed, which solves the problem of being unable to traverse all in the existing technology. Layer problems improve development efficiency and compatibility.

CN119105731APending Publication Date: 2024-12-10CHINA HUASHI ENTERPRISES CO LTD (SICHUAN)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411136328.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-12-10

AI Technical Summary

Technical Problem

The asynchronous execution of Lisp programs in AutoDesk CAD software leads to restrictions on secondary development, and it is impossible to traverse all CAD layers through normal loop conditions to perform Lisp operations. The existing methods need to rewritten the source code and have compatibility problems.

Method used

By setting the timer and program result judgment, preprocessing the CAD drawing to obtain the layer start time of the Lisp command, using the timer to realize the loop execution of the Lisp command, traversing the layer and executing the next layer command after the timer countdown ends. .

Benefits of technology

It realizes the rapid completion of multi-task operations in CAD, saves time, adapts to diverse scenarios, avoids repeated development, and takes advantage of the lightweight features of the Lisp language to save cycle time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119105731A_ABST
    Figure CN119105731A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of software secondary development and design, and discloses a Cad-based Lisp program loop execution method, which comprises the following steps of: obtaining the starting time of a layer which needs to execute a Lisp command and recording the starting time in a timer, the processing time for processing the execution object by executing the Lisp command in the layer to be executed with the Lisp command is set in the timer; starting a timer; starting the timer when the timing time of the timer reaches the starting time between the layers on which the Lisp command is to be executed; and judging whether a layer needing to execute the Lisp command exists or not, if so, setting the processing time of the next layer needing to execute the Lisp command in a timer, and starting to traverse the next layer after the countdown of the timer is finished. By means of the method, the program written by Lisp can be traversed in CAD, various task operations can be rapidly completed, a large amount of time is saved, and the method is suitable for diversified scenes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of software secondary development and design, and in particular to a loop execution method, device and medium of a Lisp program based on Cad. Background Art

[0002] As the most widely used computer-aided design software on the market, AutoDesk's CAD plays an important role in the design industry. Various corresponding plug-ins and secondary development are also emerging in an endless stream. Therefore, in order to meet various needs, AutoDesk has opened up the Lisp language as an interface for secondary development. At the same time, AutoDesk has written a large number of CAD functions based on the Lisp language. However, there is a big problem with functions written in Lisp, that is, program execution is asynchronous, such as Figure 2 As shown, the logical order of execution of the normal program should be:

[0003] 1→CAD.Lisp program→2→CAD.Lisp program→3→CAD.Lisp program→…;

[0004] But the actual execution order is:

[0005] 1→2→3→4,........→CAD.Lisp program→CAD.Lisp program→CAD.Lisp program→CAD.Lisp program,............;

[0006] Furthermore, no matter where the CadLisp program is located, e.g. Figure 3 As shown, the execution result order is still:

[0007] 1→2→3→4→........→CAD.Lisp program→CAD.Lisp program→CAD.Lisp program→CAD.Lisp program,............;

[0008] This is because when CAD software was first designed, it was set that the Lisp program was input as an asynchronous program. When a Lisp input was detected in the command line, it was placed after the program ended by default for execution. This resulted in certain restrictions on the secondary development of CAD. When it comes to Lisp command calls, loop conditions cannot be added. For example, if the program wants to traverse all CAD layers to perform a certain Lisp operation, such a plug-in cannot be completed through normal thinking. The method currently used in the market is to view the Lisp source code, rewrite it into a C# or C++ program and repackage it, but this method can only be used for open source programs, and overwriting also has many compatibility issues. Summary of the invention

[0009] The present invention provides a cyclic execution method, device and medium of a Lisp program based on Cad, which solves the problem by setting a timer+program completion result determination method.

[0010] The present invention is achieved through the following technical solutions:

[0011] A loop execution method of a Lisp program based on Cad, comprising:

[0012] Preprocess the Cad drawing to be processed, obtain the start time of the layer to execute the Lisp command and record the start time in the timer, and at the same time, set the processing time of the execution object by executing the Lisp command in the layer to execute the Lisp command in the timer;

[0013] Start traversing the layers of the Cad drawings that need to be processed and start the timer;

[0014] When the timing time of the timer reaches the starting time between the layers to be executed with the Lisp command, the timer is started, and at the same time, the Lisp command of the layer to be executed with the Lisp command is executed, and it is determined whether there is a next layer, if yes, jump to the next step, otherwise, end;

[0015] Determine whether there are still layers that need to execute Lisp commands. If so, set the processing time of the next layer that needs to execute Lisp commands in the timer. After the timer countdown ends, start traversing the next layer and then return to the previous step. Otherwise, directly traverse all remaining layers and then end.

[0016] In some embodiments, the Cad drawing to be processed is preprocessed, the start time of the layer to execute the Lisp command is obtained and the start time is recorded in the timer, and at the same time, the processing time of the execution object in the layer to execute the Lisp command by executing the Lisp command is set in the timer. The specific process is:

[0017] Traverse all layers in the Cad drawing that needs to be processed, obtain the IDs of all layers that need to execute Lisp commands and the sizes of the execution objects corresponding to the layers that execute the Lisp commands, and use the IDs of the layers with the execution objects and the sizes of the corresponding execution objects as elements to form a layer set;

[0018] Let the time to traverse the layer be the traversal time, and let the time to execute the Lisp command be the processing time;

[0019] The starting time from the start of traversal to the layer where the Lisp command is to be executed is obtained from the layer set according to the id, traversal time and processing time, and the starting time from traversal to the layer where the Lisp command is to be executed is recorded in the timer. Meanwhile, the processing time of the layer where the Lisp command is to be executed is set in the timer.

[0020] As an optimization, the specific process of traversing all layers in the Cad drawing that needs to be processed and obtaining the IDs of all layers to execute Lisp commands and the sizes of the execution objects corresponding to the layers that execute Lisp commands is as follows:

[0021] A1, let i=1;

[0022] A2, judging whether the i-th layer has an execution object that needs to execute a Lisp command, if so, recording the id of the i-th layer and the size of the execution object, and then jumping to A3, otherwise, directly jumping to A3;

[0023] A3. Determine whether i is greater than N, where N is the total number of the layers. If so, end the process. Otherwise, set i=i+1 and return to A2.

[0024] As an optimization, the specific expression form of the layer set is {(id1, size 1), ···, (id v ,size v )}, where v represents the number of elements in the layer collection, id v Indicates the vth id in the layer collection, size v Indicates the size of the execution object of the layer corresponding to the vth id in the layer collection.

[0025] As an optimization, the specific formula for obtaining the start time between the start of traversal of the layer and the layer where the Lisp command is to be executed is as follows based on the id, traversal time, and processing time:

[0026] T z,始 =T b *C w,前 +∑t c,前 ;

[0027] Among them, T z,始 Indicates the starting time between the start of traversal and the layer where the Lisp command is to be executed, where the layer where the traversal starts is the first layer, and the specific number of the layer where the Lisp command is to be executed is obtained according to the corresponding id; C w,前 Indicates the number of all layers before the layer where the Lisp command is to be executed, T b Indicates the time required to traverse a layer, t c,前 Indicates the processing time of the layer to execute the Lisp command before the layer to execute the Lisp command.

[0028] As an optimization, the start time of the timer, the id of the layer to execute the Lisp command, and the processing time are recorded and set in a one-to-one correspondence.

[0029] As an optimization, the specific formula for the processing time is:

[0030] t c =t′*L;

[0031] Among them, t c is the processing time of processing the execution object by executing Lisp commands, t′ is the unit processing time of processing the smallest factor constituting the execution object, and L is the size of the execution object.

[0032] The present invention also discloses a loop execution system of a Lisp program based on Cad, comprising:

[0033] A preprocessing module is used to preprocess the Cad drawing to be processed, obtain the start time of the layer to execute the Lisp command and record the start time in the timer, and at the same time, set the processing time of the execution object in the layer to execute the Lisp command by executing the Lisp command in the timer;

[0034] The start module is used to start traversing the layers of the Cad drawings that need to be processed and start the timer at the same time;

[0035] The execution module starts the timer when the timing time of the timer reaches the starting time between the layers where the Lisp command is to be executed, and at the same time, executes the Lisp command of the current layer, and determines whether there is a next layer. If so, the determination module is started, otherwise, the process ends;

[0036] The judgment module is used to judge whether there are still layers that need to execute Lisp commands. If so, the processing time of the next layer that needs to execute Lisp commands is set in the timer according to the id and processing time. After the countdown of the timer ends, the next layer is traversed and the execution module is restarted. Otherwise, all remaining layers are traversed directly and then the process ends.

[0037] The present invention also discloses an electronic device, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a loop execution method of a Cad-based Lisp program as described above.

[0038] The present invention also discloses a storage medium storing a computer program, wherein when the computer program is executed by a processor, the computer program implements the aforementioned loop execution method of a Lisp program based on Cad.

[0039] Compared with the prior art, the present invention has the following advantages and beneficial effects:

[0040] Through the method of the present invention, programs written in Lisp can be traversed in CAD, various task operations can be completed quickly, a lot of time can be saved, and various scenarios can be adapted.

[0041] The method of the present invention avoids repeated development, utilizes the lightweight feature of the Lisp language, and saves cycle time. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The drawings described herein are used to provide a further understanding of the embodiments of the present invention, constitute a part of this application, and do not constitute a limitation of the embodiments of the present invention. In the drawings:

[0043] Figure 1 It is a flow chart of a loop execution method of a Lisp program based on Cad according to the present invention;

[0044] Figure 2 It is one of the loop processes with Lisp execution commands in the background technology;

[0045] Figure 3 This is another loop process with Lisp execution commands in the background technology. DETAILED DESCRIPTION

[0046] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with embodiments and drawings. The exemplary embodiments of the present invention and their description are only used to explain the present invention and are not intended to limit the present invention.

[0047] This embodiment 1 provides a loop execution method of a Lisp program based on Cad, such as Figure 1 As shown, including:

[0048] Preprocess the Cad drawings that need to be processed, obtain the start time of the layer where the Lisp command is to be executed and record the start time in the timer. At the same time, set the processing time of the execution object in the layer where the Lisp command is to be executed by executing the Lisp command in the timer; the timer runs in a countdown mode.

[0049] In some embodiments, the Cad drawing to be processed is preprocessed, the start time of the layer to execute the Lisp command is obtained and the start time is recorded in the timer, and at the same time, the processing time of the execution object in the layer to execute the Lisp command by executing the Lisp command is set in the timer. The specific process is:

[0050] Traverse all layers in the Cad drawing that needs to be processed, obtain the IDs of all layers that need to execute Lisp commands and the sizes of the execution objects corresponding to the layers that execute the Lisp commands, and use the IDs of the layers with the execution objects and the sizes of the corresponding execution objects as elements to form a layer set;

[0051] In some embodiments, the specific expression form of the layer set is {(id1, size 1),...,(id v ,size v )}, where v represents the number of elements in the layer collection, id v Indicates the vth id in the layer collection, size v Indicates the size of the execution object of the layer corresponding to the vth id in the layer collection.

[0052] Let the time to traverse the layer be the traversal time, and let the time to execute the Lisp command be the processing time;

[0053] The starting time from the start of traversal to the layer where the Lisp command is to be executed is obtained from the layer set according to the id, traversal time and processing time, and the starting time from traversal to the layer where the Lisp command is to be executed is recorded in the timer. Meanwhile, the processing time of the layer where the Lisp command is to be executed is set in the timer.

[0054] In some embodiments, the specific process of traversing all layers in the Cad drawing to be processed and obtaining the IDs of all layers to execute Lisp commands and the sizes of the execution objects corresponding to the layers to execute Lisp commands is as follows:

[0055] A1, let i=1;

[0056] A2, judging whether the i-th layer has an execution object that needs to execute a Lisp command, if so, recording the id of the i-th layer and the size of the execution object, and then jumping to A3, otherwise, directly jumping to A3;

[0057] A3. Determine whether i is greater than N, where N is the total number of the layers. If so, end the process. Otherwise, set i=i+1 and return to A2.

[0058] In some embodiments, the specific formula for the processing time is:

[0059] t c =t′*L;

[0060] Among them, t c is the processing time of processing the execution object by executing Lisp commands, t′ is the unit processing time of processing the smallest factor constituting the execution object, and L is the size of the execution object.

[0061] Before actually traversing the CAD drawings, the CAD drawings must be loaded and executed once in advance, so as to calculate a proportional relationship based on the size of the execution object and the running time. This proportional relationship is the unit processing time of the smallest factor that constitutes the execution object. For example, if the execution object is a paragraph of text, then the smallest factor is a word in this paragraph of text.

[0062] In some embodiments, the specific formula for obtaining the start time between the start of traversal of the layer and the layer to execute the Lisp command according to the id, traversal time, and processing time is:

[0063] T z,始 =T b *C w,前 +∑t c,前 ;

[0064] Among them, T z,始 Indicates the starting time between the start of traversal and the layer where the Lisp command is to be executed, where the layer where the traversal starts is the first layer, and the specific number of the layer where the Lisp command is to be executed is obtained according to the corresponding id; C w,前 Indicates the number of all layers before the layer where the Lisp command is to be executed, T b Indicates the time required to traverse a layer, t c,前 Indicates the processing time of the layer to execute the Lisp command before the layer to execute the Lisp command.

[0065] Since the size of each execution object may be different, t c,前 The sizes are not necessarily all the same.

[0066] The id of each layer is unique. The relative number of the layer can be obtained based on the id. If there is no execution object to execute the Lisp command in a layer, then this layer will only be traversed. If there is an execution object to execute the Lisp command in a layer, then this layer has both traversal time and processing time. Therefore, the starting time from the beginning of traversal to the layer to execute the Lisp command is the traversal time and processing time of all layers before the layer to execute the Lisp command (if the previous layer has an execution object, the processing time is counted, if not, it is not counted).

[0067] Start traversing the layers of the Cad drawings that need to be processed and start the timer;

[0068] When the timing time of the timer reaches the starting time between the layers to be executed with the Lisp command, the timer is started, and at the same time, the Lisp command of the layer to be executed with the Lisp command is executed, and it is determined whether there is a next layer, if yes, jump to the next step, otherwise, end;

[0069] Determine whether there are still layers that need to execute Lisp commands. If so, set the processing time of the next layer that needs to execute Lisp commands in the timer. After the timer countdown ends, start traversing the next layer and then return to the previous step. Otherwise, directly traverse all remaining layers and then end.

[0070] In some embodiments, the start time of the timer, the id of the layer on which the Lisp command is to be executed, and the processing time are recorded in a one-to-one correspondence.

[0071] The timer records the start time between all layers where the Lisp command is to be executed. The start time here is a relative time, that is, once the layers of the CAD drawing are actually traversed, the timer starts in time. When the relative time node recorded by the timer is reached, the corresponding layer where the Lisp command is to be executed is triggered to execute the Lisp command on the execution object. The corresponding layer can be found by id. For example, one-to-one mapping can be performed through the following table.

[0072] The start time of the timer recording id Time recorded by the timer Time 1 id1 <![CDATA[t c,1 ]]> Time 2 Id2 <![CDATA[t c,2 ]]>

[0073] In this way, once the timer reaches the preset time, the lisp command in the layer with the corresponding id can be triggered.

[0074] In some embodiments, a loop execution system of a Lisp program based on Cad is also disclosed, including:

[0075] A preprocessing module is used to preprocess the Cad drawing to be processed, obtain the start time of the layer to execute the Lisp command and record the start time in the timer, and at the same time, set the processing time of the execution object in the layer to execute the Lisp command by executing the Lisp command in the timer;

[0076] The start module is used to start traversing the layers of the Cad drawings that need to be processed and start the timer at the same time;

[0077] The execution module starts the timer when the timing time of the timer reaches the starting time between the layers where the Lisp command is to be executed, and at the same time, executes the Lisp command of the current layer, and determines whether there is a next layer. If so, the determination module is started, otherwise, the process ends;

[0078] The judgment module is used to judge whether there are still layers that need to execute Lisp commands. If so, the processing time of the next layer that needs to execute Lisp commands is set in the timer according to the id and processing time, and then the next layer is traversed after the countdown of the timer ends, and then the execution module is restarted. Otherwise, all the remaining layers are traversed directly and then ended.

[0079] Next, we will explain this through a specific case scenario. For example, the Lisp command that needs to be executed is to convert the text in the CAD drawing into vector primitives, that is:

[0080] Case scenario: In CAD, when text needs to be converted into vector primitives (when CAD drawings are imported into other software, other software cannot display text information due to font issues, so CAD text often needs to be converted into vector line segment information), CAD's native Lisp command TxtExp is needed. Now there is a demand to convert all text in all layers with the "TXT" field in the layer name through TxtExp. At this time, it is necessary to traverse all layers, then make judgments, and finally execute the TxtExp command. However, since Lisp commands are asynchronous, this requirement cannot be met. Therefore, it is necessary to proceed through multiple steps such as selection, calling, execution, and judgment.

[0081] The preprocessing module performs algorithm traversal. For example, when the text of the layer with the name "TXT" in all CAD layers needs to be TxtExp operated, the CAD block table information is read first, the layer block table is locked, and the layer block table is traversed to determine the layer with the field name "TXT". Then the counter is +1 and the layer id is recorded. Through this loop operation, the number of traversals v that the program needs to perform, the layer set Layers that need to be operated, and the number of texts S contained in the layer are determined.

[0082] Write a task Task program (i.e., execution module and judgment module), where the Task program should be used as a separate external command for CAD secondary development, and Task should eventually be added to Lisp related programs. At the same time, record the execution time of the Task program as t. (As shown in the previous case, a single Task program first traverses the layer set Layers, calls its official interface in CAD, obtains the information of all text primitives in the layer name, selects its text primitives, and executes the Lisp command TxtExp. At this point, all the text on a single layer has been blown up. The difficulty lies in measuring the execution time t, because the number of text contained in each layer is different, and the time needs to be measured based on the number of texts in the layer S. The measurement method here is the dynamic speed measurement method. When executing a task, it will preload and execute the task once. According to the number of texts and the running time, a proportional relationship is calculated, such as 30ms / word, so as to roughly simulate the computing efficiency of the computer, and thus calculate the time t required for each layer)

[0083] Set a timer T, where the interval is t, that is, the processing time (t is dynamic, and the interval of t is modified after each execution is completed, and the interval corresponds to the t value corresponding to the layer), the number of times is v, and the scheduled execution task is the Task program. By executing v Task tasks, the result is completed and the goal of traversing the program is achieved.

[0084] The above points are only one of the application points. Similar applications can be carried out in this way (similar situations, where Lisp commands need to be executed repeatedly for many times, any code program + Lisp statement structure can be carried out in this way. The present invention emphasizes a framework technology, under the application of this technology, the relationship between C# / C++ and Lisp language can be better combined to make up for the shortcomings of both.

[0085] In some embodiments, an electronic device is also disclosed, comprising at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a loop execution method of a Cad-based Lisp program as described above.

[0086] In some embodiments, a storage medium is also disclosed, storing a computer program, which, when executed by a processor, implements the aforementioned loop execution method of a Cad-based Lisp program.

[0087] The specific implementation methods described above further illustrate the objectives, technical solutions and beneficial effects of the present invention in detail. It should be understood that the above description is only a specific implementation method of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.

Claims

1. A loop execution method of a Lisp program based on Cad, characterized in that: include: Preprocess the Cad drawing to be processed, obtain the start time of the layer to execute the Lisp command and record the start time in the timer, and at the same time, set the processing time of the execution object by executing the Lisp command in the layer to execute the Lisp command in the timer; Start traversing the layers of the Cad drawings that need to be processed and start the timer; When the timing time of the timer reaches the starting time between the layers to be executed with the Lisp command, the timer is started, and at the same time, the Lisp command of the layer to be executed with the Lisp command is executed, and it is determined whether there is a next layer, if yes, jump to the next step, otherwise, end; Determine whether there are still layers that need to execute Lisp commands. If so, set the processing time of the next layer that needs to execute Lisp commands in the timer. After the timer countdown ends, start traversing the next layer and then return to the previous step. Otherwise, directly traverse all remaining layers and then end.

2. A loop execution method of a Lisp program based on Cad according to claim 1, characterized in that: The specific process of preprocessing the Cad drawing to be processed, obtaining the start time of the layer to execute the Lisp command and recording the start time in the timer, and setting the processing time of the execution object by executing the Lisp command in the layer to execute the Lisp command in the timer is as follows: Traverse all layers in the Cad drawing that needs to be processed, obtain the IDs of all layers that need to execute Lisp commands and the sizes of the execution objects corresponding to the layers that execute the Lisp commands, and use the IDs of the layers with the execution objects and the sizes of the corresponding execution objects as elements to form a layer set; Let the time to traverse the layer be the traversal time, and let the time to execute the Lisp command be the processing time; The starting time from the start of traversal to the layer where the Lisp command is to be executed is obtained from the layer set according to the id, traversal time and processing time, and the starting time from traversal to the layer where the Lisp command is to be executed is recorded in the timer. Meanwhile, the processing time of the layer where the Lisp command is to be executed is set in the timer.

3. A loop execution method of a Lisp program based on Cad according to claim 1, characterized in that: The specific process of traversing all layers in the Cad drawing that needs to be processed, obtaining the IDs of all layers that need to execute Lisp commands and the sizes of the execution objects corresponding to the layers that execute Lisp commands is as follows: A1, let i=1; A2, judging whether the i-th layer has an execution object that needs to execute a Lisp command, if so, recording the id of the i-th layer and the size of the execution object, and then jumping to A3, otherwise, directly jumping to A3; A3. Determine whether i is greater than N, where N is the total number of the layers. If so, end the process. Otherwise, set i=i+1 and return to A2.

4. A loop execution method of a Lisp program based on Cad according to claim 2, characterized in that: The specific expression form of the layer set is {(id1, size 1),...,(id v ,size v )}, where v represents the number of elements in the layer collection, id v Indicates the vth id in the layer collection, size v Indicates the size of the execution object of the layer corresponding to the vth id in the layer collection.

5. The loop execution method of a Lisp program based on Cad according to claim 2, characterized in that: The specific formula for obtaining the start time between the start of traversal layer and the layer where the Lisp command is to be executed is as follows based on the id, traversal time, and processing time: T z,始 =T b *C w,前 +∑t c,前 ; Among them, T z,始 Indicates the starting time between the start of traversal and the layer where the Lisp command is to be executed, where the layer where the traversal starts is the first layer, and the specific number of the layer where the Lisp command is to be executed is obtained according to the corresponding id; C w,前 Indicates the number of all layers before the layer where the Lisp command is to be executed, T b Indicates the time required to traverse a layer, t c,前 Indicates the processing time of the layer to execute the Lisp command before the layer to execute the Lisp command.

6. A loop execution method of a Lisp program based on Cad according to claim 2, characterized in that: The start time of the timer, the id of the layer to execute the Lisp command and the processing time are recorded and set in a one-to-one correspondence.

7. A loop execution method of a Lisp program based on Cad according to claim 2, characterized in that: The specific formula for the processing time is: t c =t′*L; Among them, t c is the processing time of processing the execution object by executing Lisp commands, t′ is the unit processing time of processing the smallest factor constituting the execution object, and L is the size of the execution object.

8. A loop execution system for Lisp programs based on Cad, characterized in that: include: A preprocessing module is used to preprocess the Cad drawing to be processed, obtain the start time of the layer to execute the Lisp command and record the start time in the timer, and at the same time, set the processing time of the execution object in the layer to execute the Lisp command by executing the Lisp command in the timer; The startup module is used to start traversing the layers of the Cad drawings that need to be processed and start the timer at the same time; An execution module, used for starting the timer when the timing time of the timer reaches the starting time between the layers where the Lisp command is to be executed, and at the same time, executing the Lisp command of the current layer, and judging whether there is a next layer, if so, starting the judgment module, otherwise, ending; The judgment module is used to judge whether there are still layers that need to execute Lisp commands. If so, the processing time of the next layer that needs to execute Lisp commands is set in the timer according to the id and processing time. After the countdown of the timer ends, the next layer is traversed and the execution module is restarted. Otherwise, all remaining layers are traversed directly and then the process ends.

9. An electronic device, characterized in that: It includes at least one processor and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute a loop execution method of a Cad-based Lisp program as described in any one of claims 1 to 7.

10. A storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for loop execution of a Lisp program based on Cad according to any one of claims 1 to 7 is implemented.