Most popular add dimension command to AutoCAD

2022-08-01
  • Detail

Add annotation commands to AutoCAD

the annotation commands provided by AutoCAD are very limited. Although some domestic secondary development software also provide some special annotations, they are not comprehensive. Therefore, users are required to add some special annotation commands. AutoCAD has many system variables, such as the fixed word height of the current text. When the system variable is zero or non-zero, the command format when writing text with the text command is different. A good application must mark the same format text as the current system setting without changing the current system variables. This requires us to read various related variables in the program and adopt the corresponding command format. However, it is inconvenient to read some system variables such as the fixed word of the text. Therefore, according to my own ads programming experience, the author has compiled some application functions that he cited in reference books, which are included in the drawing.h file for the time being. If readers want to call these functions, they only need to add a sentence "include" drawing.h "to the relevant files (the file is placed in ι acad ι Ads directory). According to the author's test, the function series can be widely used in various C language compilers, such as BC, VC and watcomc (including various versions of auto cadr12, R13 fordos and fo rwindows). The following focuses on the functions of various structural variables and functions.

"the classic extreme series and the classic optimization series of anjianeng demonstrate our commitment to delivering customer value innovation in the field of thermal insulation materials (1) The structhgy dim char structure contains three member variables. Dim scale, dim text, and dim asz respectively correspond to dims scale, dimtext, dimasz and other variables. However, in this example, dim text and dim asz are the product of dimtext, dimasz variables and dimscale respectively (see the function get dim char() for details)

(2). Function check μ Text() to check the fixed word height of the current text. If the current font name is read incorrectly, 0 will be returned. Conversely, when the fixed word height is not zero, it returns 1. When the fixed word height is jc890 ⑵ 001 masonry mortar and plaster mortar for autoclaved aerated concrete, it returns 2. after calling this function, the return value determines the format of the text command and whether to continue using the t ext command

(3). The function get dim char (structhgy dim Cha R * dimchar) gives information such as the size, location, nature and quantity of defects. The structure pointer passes values through the address. Readers can add more member variables to the structure during application and modify the function accordingly

attach another function to mark the chamfer (the dimension line is parallel to the chamfer and displayed dynamically). You can add this function to any ads demonstration file, modify the structure of the command name defined in the demonstration file, and use the corresponding batch compilation connection. This function has two features. One is to process the data of the selected entity, which is contained in the for() loop. The other is the dynamic drawing, which is included in the while () loop. The reader can try to compile the connection to understand the essence of dynamic drawing. There are mainly two ads functions, and their prototypes are given here:

1.intads μ grdarw(ads μ pointfrom,ads μ Pointt o, intcolor, inth1) to draw the loss function. When H1 is non-zero, the drawn loss is highlighted, otherwise it is displayed normally

2.intads μ Grread (inttrack, int * type, struct resultof * result), where type returns the type value and input characteristics of the device, and the read information is stored in the independent variable result. Please refer to the program and related books (end) for specific operations

Copyright © 2011 JIN SHI