AutoLISP plug-in development method for deepening steel bridge
By developing steel bridge deepening plug-ins based on AutoLISP and Visual LISP, the problems of poor compatibility and high usage thresholds of existing tools are solved, efficient graphics and data processing of steel bridge deepening design are realized, and open source solutions that are easy to modify are provided.
Patent Information
- Application Number
- CN202510227318.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-07-08
AI Technical Summary
The existing building integration plug-ins and Excel tools have poor compatibility, complex copyright ownership and high usage threshold in the deepening design of steel bridges, resulting in heavy workload for deepening designers.
Developed a steel bridge deepening plug-in based on the AutoLISP language and Visual LISP integrated environment. By simplifying the process of drawing creation, line stake, graphic drawing and data processing, it provides open source plug-ins that are easy to modify, and uses AutoLISP function functions and DCL dialog control language to realize layer management, curve drawing and data processing.
It improves the working efficiency of steel bridge drawings, optimizes the data processing and graphics drawing process, reduces the difficulty of use, meets design needs, and provides a dedicated and easy-to-modify plug-in solution.
Smart Images

Figure CN120276714A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of steel bridge deepening plug-ins, and particularly to a development method of AutoLISP plug-ins for steel bridge deepening. Background Art
[0002] In recent years, with the continuous progress of infrastructure construction, the number of different types of steel structure bridges has been increasing. Considering the gradual growth of engineering project quantities, the refinement degree of steel structure bridge design drawings also needs to be gradually improved.
[0003] In the field of steel structure bridge deepening design, there are various structural types and requirements, which pose significant challenges to lofting work. However, traditional CAD tools have defects in providing professional commands, resulting in additional workload for deepening designers. Currently, tools such as building integration plug-ins and Excel used in the industry often have problems such as poor compatibility, complex copyright ownership, and high usage thresholds. Therefore, developing a deepening design plug-in that can meet design requirements, is open-source, and is easy to modify is crucial for reducing the workload of deepening designers, lowering the usage difficulty, and optimizing the data processing process. Summary of the Invention
[0004] The purpose of the present invention is to provide a development method of AutoLISP plug-ins for steel bridge deepening, and solve the technical problems of poor compatibility, complex copyright ownership, and high usage thresholds of existing building integration plug-ins and tools such as Excel. The process of developing a deepening design plug-in based on the AutoLISP language and the Visual LISP integrated environment and some plug-in code examples are provided.
[0005] In order to achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] A development method of AutoLISP plug-ins for steel bridge deepening, the method comprising the following steps:
[0007] Step 1: Before writing the code, it is necessary to clarify the development requirements and clearly define the goals of the development project;
[0008] Step 2: Write the code. First, simplify the software settings, linear lofting, graphic drawing and modification, and data processing in the process of creating a new drawing;
[0009] Step 3: Debug the code. During the plug-in development process, error output or crashes may occur when the program runs, so code debugging is an essential link;
[0010] Step 4: Compile and integrate. The AutoLISP source code is a file with the suffix.lsp. If the source code is directly modified, the source code is compiled into a.fas file or a.VLX file.
[0011] Furthermore, in step 1, the goals should be clear and specific. The goals include the expected outcomes of the project, clearly defining the type of plugin to be developed, which belongs to the graphics processing category, data processing category, or graphics library. Also, clearly define the assumptions and constraints that may be encountered during the project implementation, and analyze the plugin development requirements. The functional requirements should include user interaction, input and output, and the non-functional requirements should include performance, maintainability, security, and encryption verification. If developing server-class plugins, data exchange formats and API interfaces also need to be considered.
[0012] Furthermore, in step 2, first simplify the specific process of software settings during the creation of a new drawing as follows: automatically import font files and drawing frame information, create and adjust permanent layers, draw reference lines, create layers for the plugin, provide options for the drafter to select the layers and reference line drawing information required at different stages, and execute the corresponding subroutines after selection. Call CAD standard commands through the command function. CAD creates layers and draws reference lines based on the written information, and sets the default layers and fonts, omitting the step of creating common layers one by one.
[0013] Furthermore, first simplify the program code for software settings during the creation of a new drawing as follows:
[0014]
[0015] Furthermore, the specific process of linear lofting in step 2 is as follows: Bridge linear lofting is to calculate the position coordinate values of corresponding bridge feature points through horizontal and vertical curve elements and pre-camber, develop a program to simplify the curve drawing and calculation process, directly output the corresponding point coordinates or draw curves after inputting a small number of key parameters, effectively avoiding calculation errors and improving drawing efficiency. If using a linear lofting plugin, only need to pick up the tangent line, input the arc radius and Ls length, and the program internally calculates the coordinates of each point on the transition curve, calls the CAD command, automatically draws the transition curve, and generates transition curve information.
[0016] Furthermore, the code for linear lofting is as follows:
[0017]
[0018]
[0019] Furthermore, the specific process of graphic drawing and modification in step 2 is as follows:
[0020] The drawing deepening develops plug-ins from aspects such as optimizing the curve processing process, simplifying the commands for graphic rotation and alignment, and parametrically drawing general parts or standard parts. Using the reference rotation and flattening plug-in, select the reference line and the primitive to be aligned. The program calculates the angle of the primitive and determines the processing method, and the primitive is aligned with the line. Using the loop and conditional statements of AutoLISP, the batch rotation plug-in rotates several primitives in the selection set to be flattened, or rotates them batch by batch according to the angle list or a fixed angle.
[0021] Further, the process of data processing in step 2 is as follows:
[0022] Read the text information and process the corresponding data and graphic information according to the deepening requirements and write them into a file. Use the data processing plug-in to read the Excel file at the specified path, reference the data in the specified row and perform calculations, write a string in the specified cell, and change the format of the specified cell.
[0023] Further, the specific process of step 3 is as follows:
[0024] The debugging process includes setting breakpoints at specific positions to pause the program execution, observing and analyzing relevant variables, making necessary modifications to the source code, and continuously or restarting the program until it can run stably. To facilitate program debugging, compilation tools will provide monitoring windows, inspection windows, and debugging tools.
[0025] Further, the specific process of step 4 is as follows:
[0026] The loading priority order of the three formats in the software is VLX, FAS, LSP. Compiling the source code into a VLX file has a higher loading priority. If it is necessary to integrate or package several source code files, it is necessary to create a project file, select the source code, set the compilation options, and finally obtain the compiled file.VLX that integrates the selected source code. The later maintenance and management of the project file are carried out through the loaded project toolbar window.
[0027] Due to adopting the above technical solutions, the present invention has the following beneficial effects:
[0028] The present invention innovates in optimizing the preliminary preparation, graphic drawing and modification processes of steel bridge drawing deepening, and enhancing the calculation accuracy. The deepening plug-in realizes innovation in multiple fields such as linear lofting, graphic processing, and data processing, significantly improving the work efficiency. It not only enriches the complex data processing and graphic processing functions, but also provides important reference for the development of subsequent similar plug-ins. It is a special plug-in that can meet the requirements of bridge design drawing deepening and is an effective way to improve work efficiency. Description of the Drawings
[0029] Figure 1 It is the Visual LISP development environment diagram of the present invention;
[0030] Figure 2 is the CAD dialog box diagram of the present invention;
[0031] Figure 3 is the debug toolbar diagram of the present invention;
[0032] Figure 4 is the plug-in source code list diagram of the present invention;
[0033] Figure 5 is the source code compilation diagram of the present invention;
[0034] Figure 6 is the source code compilation and integration diagram of the present invention;
[0035] Figure 7 is the post-maintenance diagram of the project file of the present invention;
[0036] Figure 8 is the source code diagram of the layer creation plug-in of the present invention;
[0037] Figure 9 is the operation result diagram of the layer creation plug-in of the present invention;
[0038] Figure 10 is the source code diagram of the easement curve plug-in of the present invention;
[0039] Figure 11 is the operation result diagram of the easement curve plug-in of the present invention;
[0040] Figure 12 is the source code diagram of the reference rotation leveling plug-in of the present invention;
[0041] Figure 13 is the operation result diagram of the reference rotation primitive plug-in of the present invention;
[0042] Figure 14 is the source code diagram of the data processing plug-in of the present invention;
[0043] Figure 15 is the operation result diagram of the data processing plug-in of the present invention. Detailed implementation manners
[0044] To make the objectives, technical solutions and advantages of the present invention more clear and understandable, the following preferred embodiments are given with reference to the accompanying drawings to further elaborate on the present invention. However, it should be noted that many details listed in the specification are only for enabling the reader to have a thorough understanding of one or more aspects of the present invention, and these aspects of the present invention can be implemented even without these specific details.
[0045] Development tools: Common development tools for CAD software include Developer Tools, Visual LISP IDE, Emacs, SLIME, etc. These tools provide many Lisp programming features. The development tools introduced this time are AutoLISP language and Visual LISP integrated environment.
[0046] AutoLISP (Auto List Processing) is an artificial intelligence language, a subset of COMMONLISP embedded in CAD. It combines the characteristics of a rapid development tool with the flexibility of COBOL. The language has a large number of open source code resources. At the same time, thanks to the built-in lisp compiler of the CAD system, users can directly debug the program in the compiler environment.
[0047] Visual LISP integrated environment is developed based on AutoLISP and is a complete development environment that comes with the CAD software platform. Figure 1 ), including text editor, formatter, syntax checker, source code debugger, inspection and monitoring tools, file compiler, project management system, context-sensitive help and automatic matching functions and intelligent console. As an upgraded version of AutoLISP language, Visual LISP has been expanded on the basis of the original language, and with the help of Microsoft ActiveX Automation interface, it has enhanced the interaction ability with AutoCAD objects. In addition, it also allows users to expand the response event function of AutoLISP through reactor functions.
[0048] Currently, mainstream CAD software on the market all support secondary development through the AutoLISP language. The commonly used APIs (application programming interfaces) of CAD software are shown in Table 1:
[0049] Table 1 Excerpts of commonly used CAD APIs
[0050]
[0051] An AutoLISP plug-in development method for steel bridge deepening, the method comprising the following steps:
[0052] Step 1: Define Requirements. Before writing code, it is necessary to clearly define the development requirements, specifically define the main goals of the development project, which should be clear and specific, including the expected results of the project. Clearly define the type of plug-in to be developed (such as graphic processing, data processing, graphic library, etc.), and clarify the assumptions and constraints that may be encountered during the project implementation (such as time, resources, etc.). Analyze the plug-in development requirements. Functional requirements should include user interaction, input and output, etc. (introduce DCL), and non-functional requirements should include performance, maintainability, security (encryption verification), etc. If developing server-class plug-ins, it is also necessary to consider data exchange formats, API interfaces, etc.
[0053] Step 2: Write Code. The key to writing a good program is to combine the AutoLISP syntax structure with functional functions. The AutoLISP syntax structure has fewer rules. To deepen plug-in development, it is necessary to master the basic rules (such as structural symmetry, expression format requirements, multiple expression operation order, etc.).
[0054] AutoLISP functional functions (keywords such as subroutines, procedures, operators, etc. in general computer languages are all called functions in AutoLISP) include command (call CAD commands), mathematical operations, inspection and logical operations, conversion operations, list processing, file processing, geometric operations, object processing, selection set processing, etc., which are the core content of AutoLISP.
[0055] Supplement to the DCL Dialog Box: DCL, that is, Dialogue Control Language, is similar to a form program and can increase the visibility of the operation interface ( Figure 2 ).
[0056] Step 2.1: Deepen the Preliminary Preparation. Simplify the software settings during the process of creating a new drawing, automatically import font files and drawing frame information, create and adjust permanent layers, draw reference lines, etc. For example: After creating a new CAD drawing, it is necessary to re-add layers and set parameters such as layer names, colors, line types, line widths, and printing settings, which is a cumbersome process. The plug-in creates layers ( Figure 8 ), provides options for drafters to select the layers and reference line drawing information required at different stages, and after selection, executes the corresponding subroutine. Call CAD standard commands through the command function, and CAD creates layers and draws reference lines according to the written information ( Figure 9 ), and sets the default layers and fonts, omitting the step of creating each common layer one by one. Specific programming:
[0057]
[0058] Step 2.2: Bridge alignment lofting means calculating the position coordinate values of corresponding bridge feature points through horizontal and vertical curve elements and pre-camber. Develop a program to simplify the curve drawing and calculation process. After inputting a small number of key parameters, directly output the corresponding point coordinates or draw the curve, effectively avoiding calculation errors and improving drawing efficiency. For example: In the original CAD, there are no commands related to line type lofting. It is only possible to calculate the point coordinates externally and then draw the line type curve through the CAD line drawing command. If encountering a transition curve or a complex line type, the calculation formula is complex and extremely prone to errors. If using a line type lofting plug-in, only need to pick up the tangent line, input the arc radius and the length of Ls, and the program internally calculates the coordinates of each point of the transition curve ( Figure 10 ), call the CAD command, automatically draw the transition curve, and generate the transition curve information ( Figure 11 ). Specific programming:
[0059]
[0060] Excerpt of the calculation process of the subroutine:
[0061]
[0062]
[0063] Step 2.3: Graphic drawing and modification. Graphic operation is the main direction of plug-in development. The drawing deepening can develop plug-ins from aspects such as optimizing the curve processing process (such as finding specific points of the curve, curve connection, etc.), simplifying commands such as graphic rotation and alignment, and drawing parametric general parts or standard parts. For example: For the original CAD rotation command, it is necessary to select the graphic element and then input the rotation angle and rotation point, and it can only operate on a single selection set. If using the reference rotation and leveling plug-in ( Figure 12 ), select the reference line and the graphic element to be aligned, and the program calculates the angle of the graphic element and judges the processing method (such as avoiding the value of tan90° etc.), and aligns the graphic element with the line ( Figure 13 ); Using the loop and conditional statements of AutoLISP, the batch rotation plug-in can level multiple graphic elements in the selection set, or rotate them batch by the angle list or a fixed angle (traverse the graphic elements and rotate them one by one). Specific programming:
[0064]
[0065] Processing of special angle values:
[0066]
[0067] Finding the text angle:
[0068]
[0069] Step 2.4: Data processing, including the reading and writing operations of CAD for other files, reading text information, processing corresponding data according to the deepening requirements, and writing graphic information into files, etc. For example, the original CAD has very few functions for reading data files, and external files are only limited to directly writing primitive information, with a cumbersome process and unable to process data during the writing process. If a data processing plugin ( Figure 14 ) is used, it can be used to read Excel files in a specified path, reference data in specified rows for calculation, write strings in specified cells, change the formats of specified cells, etc. ( Figure 15 ). Specific programming:
[0070]
[0071] Excerpt of the operation process of table content:
[0072]
[0073]
[0074] The development of the steel bridge deepening AutoLISP plugin aims to optimize the preliminary preparation, graphic drawing and modification processes of steel bridge drawing deepening, and enhance the accuracy of calculation. The deepening plugin has achieved innovation in multiple fields such as linear lofting, graphic processing, and data processing, significantly improving work efficiency. It not only enriches complex data processing and graphic processing functions, but also provides important reference for the development of subsequent similar plugins. The examples of the bridge deepening AutoLISP plugin are introduced in detail, and the main trends and specific steps of the bridge deepening plugin development are elaborated in depth, in order to provide reference for the development of future related plugins.
[0075] Matters not covered by the present invention are well-known technologies.
[0076] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art in this technical field, without departing from the principle of the present invention, several improvements and refinements can still be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.
Claims
1. Development method of AutoLISP plug-in for steel bridge deepening, characterized in that: The method includes the following steps: Step 1: Before writing the code, it is necessary to clarify the development requirements and clearly define the goals of the development project. Step 2: Code writing. First, simplify the software settings, linear lofting, graphic drawing and modification, and data processing in the process of creating a new drawing. Step 3: Code debugging. During the plug-in development process, error outputs or crashes may occur when the program runs, so code debugging is an essential link. Step 4: Compilation and integration. The AutoLISP source code is a file with the suffix.lsp. For the source code directly modified, the source code is compiled into a.fas file or a.VLX file.
2. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, characterized in that: In Step 1, the goals should be clear and specific. The goals include the expected results of the project, clearly defining the type of plug-in to be developed, which belongs to the graphic processing category, data processing category or graphic library, clarifying the assumptions and constraints that may be encountered during the project implementation process, analyzing the development requirements of the plug-in, the functional requirements should include user interaction, input and output, and the non-functional requirements should include performance, maintainability, security, encryption verification. If developing a server-class plug-in, the data exchange format and API interface also need to be considered.
3. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, characterized in that: In Step 2, the specific process of first simplifying the software settings in the process of creating a new drawing is as follows: Automatically import font files and drawing frame information, create and adjust the standing layers, draw reference lines, create layers for the plug-in, provide options for the drafters to select the layers and reference line drawing information required at different stages, and execute the corresponding subroutines after selection. Call CAD standard commands through the command function, and CAD creates layers and draws reference lines according to the written information, and sets the default layers and fonts, omitting the step of creating common layers one by one.
4. The AutoLISP plug-in development method for steel bridge deepening according to claim 3, characterized in that: The program code for first simplifying the software settings in the process of creating a new drawing is as follows: (defun c:CJ( / aa); (initget "1 2 3 4") (setq aa (getkword "\n<1> Line type drawing\n<2> Unit…;\nEnter 1-4:")); (if (= aa "1") (zhl-xxt)); ) (defun zhl-xxt() (setvar "CMDECHO" 0) (setq chklay (tblsearch "layer" "structural layer")) (if (null chklay); (command "LAYER" "n" "structural layer" "c" "7" "structural layer")) 5. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, characterized in that: In Step 2, the specific process of linear lofting is as follows: Bridge linear lofting is to calculate the position coordinate values of the corresponding bridge feature points through horizontal and vertical curve elements and pre-arch, develop a program to simplify the curve drawing and calculation process, directly output the corresponding point coordinates or draw curves after inputting a small number of key parameters, effectively avoiding calculation errors and improving drawing efficiency. If using a linear lofting plug-in, only need to pick up the tangent line, input the arc radius and Ls length, and the program internally calculates the coordinates of each point of the transition curve (, calls the CAD command, automatically draws the transition curve, and generates transition curve information.
6. The AutoLISP plug-in development method for steel bridge deepening according to claim 5, characterized in that: The code for linear lofting is as follows: (defun c:hq( / pt…); (command "ucs") (setq p1 nil p2 nil) (while (= p1 nil) (setq p1 (entsel "\nPick the first tangent line:"))) (redraw (car p1) 3) (while (= p2 nil) (setq p2 (entsel "\nPick the second tangent line:"))) (redraw (car p2) 3) (initget 1) (setq R (getdist "\nPlease enter the radius R of the circular curve:")) (initget 1 "Ls V") (setq p3 (getdist "\nEnter the length of the transition curve (Ls):")) (if (= p3 "V") (lenl_v) (progn (setq ls p3) (lenl_d))) 7. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, characterized in that: The specific process of graphic drawing and modification in Step 2 is as follows: For the drawing deepening, plugins are developed from aspects such as optimizing the curve processing process, simplifying the commands for graphic rotation and alignment, and parametric drawing of general parts or standard parts. Use the reference rotation and flattening plugin, select the reference line and the primitive to be aligned. The program calculates the angle of the primitive and judges the processing method, and aligns the primitive with the line. Utilize the loop and conditional statements of AutoLISP, and the batch rotation plugin to flatten several primitives in the selection set, or rotate them batch by batch according to the angle list or fixed angle.
8. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, characterized in that: The process of data processing in Step 2 is as follows: Read the text information and process the corresponding data according to the deepening requirements, write the graphic information into a file, and use the data processing plugin to read the Excel file at the specified path, reference the data in the specified row and perform calculations, write a string in the specified cell, and change the format of the specified cell.
9. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, characterized in that: The specific process of Step 3 is as follows: The debugging process includes setting breakpoints at specific positions to pause the program execution, observing and analyzing relevant variables, making necessary modifications to the source code, and continuously or restarting the program until it can run stably. To facilitate program debugging, compilation tools all provide monitoring windows, inspection windows, and debugging tools.
10. The AutoLISP plug-in development method for steel bridge deepening according to claim 1, wherein: The specific process of Step 4 is as follows: The loading priority order of the three formats in the software is VLX, FAS, LSP. Compiling the source code into a VLX file has a higher loading priority. If several source code files need to be integrated or packaged, an engineering file needs to be created, select the source code, set the compilation options, and finally obtain the compiled file.VLX that integrates the selected source code. The later maintenance and management of the engineering file are carried out through the loaded engineering toolbar window.