A method and system for batch generating AutoCAD drawing layouts with automatically updating title bars
By creating dynamic drawing frame blocks in AutoCAD and using plug-in technology to automatically update drawing title block information and generate layouts, the problems of cumbersome drawing title block generation and insufficient flexibility in batch printing in the existing technology are solved, and efficient drawing management and printing are achieved.
Patent Information
- Application Number
- CN202411240198.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-05
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2044-09-05
AI Technical Summary
Generating drawing title block information in AutoCAD is cumbersome. Existing batch printing plug-ins lack flexibility and make it difficult to generate virtual print files in one go. Frequent modifications to drawing content result in a huge workload.
By creating a dynamic block of the drawing frame containing title block information and using AutoCAD secondary development technology to develop a plug-in, the reference object of the dynamic block of the drawing frame can be automatically identified, the drawing layout can be generated, and the automatic update and batch printing of the title block information can be achieved through the custom properties of the drawing set.
It improves the efficiency of drawing layout generation and modification, enhances the consistency of drawing information, reduces manual operation steps, realizes efficient batch printing and virtual printing of drawings, and meets users' flexible printing needs.
Smart Images

Figure CN119513950B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application belongs to the field of engineering design drawing, and particularly discloses a method and system for batch generating AutoCAD drawing layout with automatically updated title bar. BACKGROUND
[0002] In the fields of building engineering, civil engineering and mechanical manufacturing, AutoCAD is a general software for engineering design in these industries, but after the completion of graphic drawing by AutoCAD, the process of adding drawing frame, manually filling or modifying drawing title bar information and completing printing of drawings is very tedious, and the following several conventional operations are often used in actual production:
[0003] Method one: without using AutoCAD layout function, all contents are directly drawn in model view, and drawing frame is manually placed, title bar information in each drawing frame such as drawing name, drawing number and printing date is manually written, and the built-in printing prompt window is used to frame the outer line of drawing frame, select printer or plotter, select printing style and print each drawing represented by the drawing frame one by one. This method needs manual operation for printing of each drawing, and the steps are very tedious and the efficiency is very low.
[0004] Method two: model view and layout view are mixedly used, a part of graphic drawing is completed in model view, a default drawing layout page is generated by AutoCAD, one or more drawing frames are manually drawn in the page, title bar information of the drawing frame is manually filled or modified, and viewport linking a certain area in model view is manually placed in the inner line of each drawing frame. This method does not use layout range printing, and still needs to frame each drawing frame range in layout to determine the printing range of each time (each drawing) and manually configure printing parameters in each printing process, so this method is similar to method one, the steps are very tedious and the efficiency is very low.
[0005] Method three, on the basis of method one and method two, using the function of AutoCAD general block, making the frame as a general block, and then using the secondary development technology to write the plug-in of batch printing function, finding the aforementioned frame general block reference object in the model view or layout view, using the program to complete the printing of drawings in batches, and the printing range of each drawing is set by the program as the outer edge line of the frame general block, and all the printing processes use the same printer / drawing instrument and the same printing style. There are many batch printing plug-ins on the market, most of which are developed based on method three. Although this method has certain efficiency improvement, it still has many limitations. First of all, when a project needs to be printed, all the graphic files still need to be opened manually, and the batch printing command needs to be run for each opened graphic file. This process often takes a lot of time. Secondly, this method cannot generate a single virtual printing file at one time, such as a single dwf or a single pdf file. Thirdly, this method uses general blocks to realize the positioning of the drawing printing range, but the title bar information of the drawing still needs to be filled in manually. In actual production process, the content of the drawing and the title bar are modified frequently, and the printing operation after modification is also very frequent. When there are a large number of graphic files in the project, it takes a lot of work and time to open, modify and print each file. Finally, such batch printing plug-ins usually cannot select part of the frame content for printing after scanning all the frames, and the flexibility of selection is not enough, which cannot meet the printing needs of users. SUMMARY
[0006] In order to overcome the above-mentioned deficiencies and make full use of the characteristics of batch updating and printing of AutoCAD drawing set, the present application provides a method for batch generating AutoCAD drawing layout with automatically updated title bar, comprising the following steps:
[0007] S1: making a frame dynamic block containing title bar information in AutoCAD, and each time the frame dynamic block is inserted in the model view, a frame dynamic block reference object with the attribute of the frame dynamic block will be generated; the frame dynamic block can automatically adjust the individual data of each frame dynamic block reference object by selecting the drawing size option, and the individual data includes but is not limited to frame dynamic block name, drawing size, drawing area size, title bar style and dynamic field related to drawing information in the title bar; the dynamic field is expressed by the frame dynamic block attribute, and the frame dynamic block attribute is linked with the attribute of the drawing set;
[0008] S2: developing a plug-in using AutoCAD secondary development technology, the plug-in has an interactive interface for prompting how to select specific frame dynamic block reference objects in the model view, and the following steps are completed:
[0009] In the opened AutoCAD drawing file, according to the selected one or more frame block reference objects in the model view, generate a drawing layout corresponding to each frame block reference object, and automatically configure the page settings of the drawing layout;
[0010] In the printable range of each drawing layout, insert a layout view frame block reference object and a polygonal viewport, the polygonal viewport completely coincides with the drawing area polygon in the layout view frame block reference object, and the polygonal viewport is aligned with the drawing area of the corresponding frame block reference object in the model view;
[0011] S3: According to the printing requirements, insert one or more frame blocks in the model view, and set the frame block reference objects to be arbitrarily scaled or rotated; load the plug-in in the AutoCAD software, and select the same type of frame block reference object through the interactive interface to generate one or more drawing layouts;
[0012] S4: New drawing set, add matching custom drawing set attributes and assign values, add the generated drawing layout to the drawing set, and automatically synchronize the update of the dynamic fields in the drawing layout frame through linking;
[0013] S5: Select one or more drawing layouts by direct selection or selection in the drawing set, and perform batch printing.
[0014] Preferably, the AutoCAD plug-in development technology includes but is not limited to AutoLisp, objecARX,.net API and Javascript API programming tools.
[0015] Preferably, the input of the individual data adopts any of the following methods:
[0016] Select one or more inserted frame block reference objects in the AutoCAD model view as individual data;
[0017] Enter the name of one or more inserted frame blocks in the AutoCAD command prompt bar or dialog box as individual data.
[0018] Preferably, the automatic configuration of the page settings of the drawing layout includes the following steps:
[0019] Pre-made one or more files containing layout page setting parameter rules, saved in a specified location, automatically read by the plug-in program;
[0020] Or generate a pop-up window, panel or other graphical user interface for user to input the page setting parameters of the generated drawing layout.
[0021] Preferably, the page setting parameters include, but are not limited to, printer / drawing instrument name, drawing size, print area-print range, print offset, print style, print option, drawing direction.
[0022] Preferably, the method for linking the drawing frame dynamic block attribute with the attribute of the drawing set is: using the AutoCAD self-provided function command, a new drawing set is created, and a custom property is added to the new drawing set, for the drawing layout added therein, the title bar of the drawing frame dynamic block reference object in the layout view thereof is dynamically linked to the custom property of the drawing set, and is synchronously updated.
[0023] Preferably, each dynamic block reference object in the model view is used for positioning the spatial range of each drawing, and the drawing area thereof is the drawing area of the final printed drawing, for matching the content to be printed into a drawing, the operation of inserting the drawing frame dynamic block further includes the steps of adjusting the position, scale and rotation angle of the dynamic block reference object.
[0024] Preferably, the printing includes physical printing or generating a virtual printing file, wherein the virtual printing file includes, but is not limited to, pdf, dwf, dwfx, jpg, png type files.
[0025] Another aspect of the present application is to provide a non-transient readable recording medium for storing one or more programs containing a plurality of instructions, when the instructions are executed, will cause the processor to execute the above-mentioned method for batch generating AutoCAD drawing layout with automatically updated title bar.
[0026] Still another aspect of the present application is to provide a geographic data encryption system, including a processing circuit and a memory electrically coupled thereto, the memory is configured to store at least one program, the program contains a plurality of instructions, the processing circuit runs the program, and can execute the above-mentioned method for batch generating AutoCAD drawing layout with automatically updated title bar.
[0027] Compared with the prior art, the present application has the following beneficial effects:
[0028] The present application aims at the problems in the engineering design industry, such as many manual operation steps, huge time consumption, poor consistency of modified information, difficult drawing management, etc. in the process of drawing integrated management, drawing title bar information modification and printing / publishing, adopts AutoCAD secondary development technology, compiles a general plug-in, and realizes efficient drawing layout generation and management, modification of drawing title bar information, and batch printing and publishing of drawings (including virtual printing).
[0029] The full automatic operation process of recognizing the frame dynamic block reference object in the model view to the corresponding generated layout is completed through the plug-in technology of secondary development, the complicated operation steps of manually generating multiple directly printable layouts are avoided, and the generation efficiency of the layout is greatly improved; the positioning and marking of different printing areas in the model view are realized by fully utilizing the "one block definition, multiple appearance performance" characteristics of the dynamic block, the dynamic block frame technology is not only the basis for realizing the functions of the plug-in system, but also can enhance the neatness and orderliness of the graphic file; the "hyperlink" characteristics of the attribute block are fully utilized, the drawing set self-defined characteristics are linked to the frame dynamic block reference object, the automatic modification of the corresponding linked attributes in the title bar of the dynamic block reference object is realized by modifying the self-defined characteristic values in the drawing set, the effect of "one modification, all drawing title bar information is updated" is achieved, the drawing information consistency is enhanced, the mistakes and omissions are reduced, the title bar content can be updated without opening the graphic file, and the modification efficiency of the drawing is greatly improved; the layout management function of the drawing set is fully utilized, the selective batch printing of the specified part or all drawings in the drawing layout list is implemented, and the whole printing process can be automatically completed without opening any drawing file, and the printing efficiency is greatly improved; BRIEF DESCRIPTION OF DRAWINGS
[0030] Figure 1 is a frame dynamic block manufacturing style schematic diagram in the embodiment of the application;
[0031] Figure 2 is a dynamic block query parameter schematic diagram in the embodiment of the application;
[0032] Figure 3 is a dynamic block title bar schematic diagram in the embodiment of the application;
[0033] Figure 4 is a dynamic block title bar attribute link schematic diagram in the embodiment of the application;
[0034] Figure 5 is an inserted frame block schematic diagram in the AutoCAD model view in the embodiment of the application;
[0035] Figure 6 is a preset page setting parameter list diagram when automatically generating a drawing layout in the embodiment of the application;
[0036] Figure 7 is a software interface after generating a drawing layout in the embodiment of the application;
[0037] Figure 8 is a page setting interface of automatically generating a drawing layout by using the plug-in in the embodiment of the application;
[0038] Figure 9is the screenshot of the self-defined property and assignment of the drawing set in the embodiment of the present application;
[0039] Figure 10 is the comparison chart of the dynamic fields before and after adding the drawing set in the embodiment of the present application. DETAILED DESCRIPTION
[0040] In order to make the purpose, technical scheme and advantages of the embodiment of the present application more clear, the technical scheme in the embodiment of the present application will be described below in combination with the drawings in the embodiment of the present application, and the described embodiment is a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by the person skilled in the art without making innovative labor are within the protection scope of the present application.
[0041] In combination with the drawings in the specification, an embodiment of the method for batch generating the AutoCAD drawing layout with automatically updated title bar is as follows: the specific steps of the technical scheme are as follows:
[0042] A drawing frame dynamic block containing a title bar is made in AutoCAD, and the dynamic block contains two basic contents: frame inner and outer lines and the title bar. Taking the water conservancy and hydropower engineering industry as an example, the dynamic block style made is as shown in Figure 1 , wherein the blue annotations are the dynamic block parameters used; the query parameter list made is as shown in Figure 2 ; one of the title bars made is as shown in Figure 3 , wherein the red circled text is the "block attribute", which is also the dynamic field mentioned in the present application, and these attributes all have hyperlink properties, such as the "project name 1" which is linked to the current drawing set self-defined property "project name 1" (as shown in Figure 4 ), so that when the value of "project name 1" in the drawing set is modified, the value of "project name 1" of the drawing frame block in the drawing layout will also be automatically updated and displayed; other block attributes in the title bar are similar to be made, and will not be described herein.
[0043] By using the AutoCAD plug-in development technology, including but not limited to using AutoLisp, objecARX,.net API, Javascript API and other tools, a functional plug-in is developed, and the plug-in is loaded in AutoCAD by using plug-in loading commands such as appload, netload, script and the like.
[0044] In the model view drawing interface of AutoCAD, according to actual needs, one or more dynamic blocks with any scaling ratio and any rotation angle are inserted. For the convenience of illustration, the application inserts four picture frame dynamic blocks made in the S1 step in the AutoCAD model view, and selects the sizes of the picture frames as A3, A2, A1 and A0 respectively, adjusts the global scale of the dynamic blocks to 100, and sets the rotation angles of the A3, A2 and A1 dynamic blocks to 15° to match the contents to be printed into pictures, and after completion, as shown in Figure 5 .
[0045] After loading the plug-in developed in the foregoing steps, the command of batch generating picture layouts can be executed, according to the command prompt, after selecting any one of the picture frame dynamic blocks, the plug-in program automatically searches all dynamic blocks of the same type in the model view, obtains four picture frame dynamic block reference objects, finds the page setting parameters matching the picture frame dynamic block map in the preset page setting table (as shown in Figure 6 ), and automatically generates four picture layouts according to these parameters, wherein each picture layout corresponds to one page of picture to be printed / published in the model view. After opening one of the generated picture layouts, the software interface is as shown in Figure 7 . The page setting interface of the picture layout is opened, as shown in Figure 8 , it can be seen that the printer / drawing instrument name, picture size and print style table of the picture layout are consistent with the A3 size shown in Figure 6 . And the print area (print range) has been set to “layout”, which indicates that the picture layout can already be executed for automatic printing / publishing.
[0046] Using the AutoCAD self-function command, a new picture set is created, and all custom properties required by the dynamic block title bar attribute are added to the picture set, and then the custom properties are assigned values. A typical picture set custom property example is shown in Figure 9 . Using the AutoCAD self-function command, the picture layout is selected and added to the newly created picture set, and AutoCAD software will automatically update the title bar information in the picture layout frame. The frame title bar of the picture layout before and after being added to the picture set is as shown in Figure 10 . Before being added to the picture set, “####” in the title bar indicates that it is not linked to the corresponding property value, and after being added to the picture set, the dynamic block attribute in the title bar is updated to the corresponding property value in the picture set. If the picture set properties need to be modified later, the picture set manager of AutoCAD can be used to modify the custom property values, and after modification, the frame title bar in the picture layout will be automatically updated.
[0047] Using the built-in function of AutoCAD's drawing set, the drawing layout in it is added. All the drawing layouts added in the drawing set are displayed as drawing lists, and one or more of these list items can be selected at the same time. The selected drawing layout is directly published by the drawing set function to complete the batch printing / publishing of drawings.
[0048] Those skilled in the art will appreciate that embodiments of the application can be supplied as methods, systems, or computer program products. Accordingly, the application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the application can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, magnetic disks, CD-ROMs, optical storage media, and the like) embodying computer readable program code.
[0049] The application is described in reference to the flow diagrams and / or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each block of the flow diagrams and / or block diagrams, and combinations of blocks in the flow diagrams and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general purpose computer, special purpose computer, embedded processing machine, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 means for performing one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0050] These computer program instructions can also be stored in a computer- readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instructions which implement the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 means for performing one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0051] These computer program instructions can also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the flow diagrams and / or block diagrams block or blocks. Figure 1 one or more functions specified in the flow diagram and / or block diagram block or blocks. Figure 1 means for performing one or more functions specified in the flow diagram and / or block diagram block or blocks.
[0052] Therefore, the method steps are assembled into a program and stored in a hard disk or other non-transient storage medium, which constitutes the "non-transient readable recording medium" technical solution of the present application; and the storage medium is electrically connected with the computer processor, and the AutoCAD drawing layout of the batch generation of the title bar automatic update can be completed through data processing, which constitutes the "system for batch generating AutoCAD drawing layout of title bar automatic update" technical solution of the present application.
[0053] Finally, it should be noted that: the above only for the preferred embodiments of the present application, and not for limiting the present application, although the foregoing embodiments of the present application are described in detail, for those skilled in the art, it still can be modified, or the equivalent replacement of part of the technical features recorded in the foregoing embodiments. Any modification, equivalent replacement, improvement, etc. within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A method for batch generating AutoCAD drawing layouts with automatically updating title bars, characterized in that The method comprises the following steps: S1: making a frame dynamic block containing title bar information in AutoCAD, and each time the frame dynamic block is inserted in the model view, a frame dynamic block reference object with frame dynamic block properties is generated; the frame dynamic block can automatically adjust the individual data of each frame dynamic block reference object by selecting the sheet size option of the drawing, and the individual data includes the frame dynamic block name, the sheet size, the drawing area size, the title bar style and the dynamic fields in the title bar related to the drawing information; the dynamic fields are expressed by the frame dynamic block properties, and the frame dynamic block properties are linked with the properties of the drawing set; S2: developing a plug-in by using the secondary development technology of AutoCAD, the plug-in has an interactive interface for prompting how to select the specific frame dynamic block reference object in the model view in AutoCAD, and the following steps are completed: in the opened AutoCAD graphic file, according to the selected one or more frame dynamic block reference objects in the model view, a drawing layout corresponding to each frame dynamic block reference object is generated, and the page settings of the drawing layout are automatically configured; in the printable range of each drawing layout, a frame dynamic block reference object of a layout view and a polygonal viewport are inserted, the polygonal viewport is completely overlapped with the drawing area polygon in the frame dynamic block reference object in the layout view, and the polygonal viewport is aligned with the drawing area of the corresponding frame dynamic block reference object in the model view; S3: according to the printing requirements, one or more frame dynamic blocks are inserted in the model view, and the frame dynamic block reference objects are set to be arbitrarily scaled or rotated; the plug-in is loaded in the AutoCAD software, and the user selects the same type of frame dynamic block reference object through the interactive interface to generate one or more drawing layouts; S4: a new drawing set is created, the matching custom drawing set properties are added and assigned, the generated drawing layout is added to the drawing set, and the dynamic fields in the frame of the drawing layout are automatically updated through the link; S5: one or more drawing layouts are selected by direct selection or selection in the drawing set, and batch printing is performed.
2. A method for batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 1, wherein, The AutoCAD plug-in development technology includes AutoLisp, objecARX,.net API and Javascript API programming tools.
3. A method of batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 2, wherein, The input of the individual data adopts any one of the following methods: selecting one or more inserted frame block reference objects in the AutoCAD model view as the individual data; inputting the name of one or more inserted frame blocks in the AutoCAD command prompt bar or dialog box as the individual data.
4. A method of batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 3, wherein, The automatic configuration of the page settings of the drawing layout comprises the following steps: one or more files containing layout page setting parameter rules are made in advance, saved in a specified position, and automatically read by the plug-in program; or a pop-up graphical user interface including a window and a panel is generated for the user to input the page setting parameters of the generated drawing layout.
5. A method of batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 4, wherein, The page setting parameters include the printer name, the drawing size, the printing range, the printing option and the graphic direction.
6. A method of batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 5, wherein, The method for linking the frame dynamic block attribute with the attribute of the drawing set is as follows: using the AutoCAD self-contained function command, a drawing set is newly created, and a custom property is added to the newly created drawing set, for the drawing layout added therein, the title bar of the frame dynamic block reference object in the layout view thereof is dynamically field linked to the custom property of the drawing set, and is synchronously updated.
7. A method of batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 6, wherein, Each dynamic block reference object in the model view is used for positioning the spatial range of each drawing sheet, and the drawing area thereof is the drawing area of the final printed drawing sheet, for matching the content required to be printed into a drawing, the operation of inserting the frame dynamic block further includes the steps of adjusting the position, scaling ratio and rotation angle of the dynamic block reference object.
8. A method of batch generating AutoCAD drawing layouts with automatically updating title bars as claimed in claim 7, wherein, The printing includes entity printing or generating a virtual printing file, wherein the virtual printing file includes a pdf, dwf, dwfx, jpg, png type file.
9. A non-transitory readable recording medium for storing one or more programs comprising a plurality of instructions, characterized in that: When the instructions are executed, the processor will execute the method for batch generating the AutoCAD drawing layout with automatically updated title bar according to any one of claims 1-8.
10. A system for batch generating AutoCAD drawing layouts with automatically updating title bars, comprising a processing circuit and a memory electrically coupled to the processing circuit, wherein the processing circuit is configured to: The memory is configured to store at least one program, the program comprising a plurality of instructions, and the processing circuit runs the program, and can execute the method for batch generating the AutoCAD drawing layout with automatically updated title bar according to any one of claims 1-8.
Citation Information
Patent Citations
Batch printing method, system and equipment for drawings and computer readable storage medium
CN113495700A
System and method for automatically drawing set of distribution network single line diagram based on multivariate data fusion
CN114996886A