Utility tool for adjusting line width

Utility tool for adjusting line width

In the work of using AutoCAD drawing software to draw all kinds of graphics. The final stage is to output the graphic file as a drawing on the printer and plotter. The division of the thickness of the graphic lines is a task that must be taken seriously. Because the graphics on the general drawing can not distinguish the pixels and structure like the colors and shades on the color display, it can only be achieved by changing the thickness of the line. Therefore, dividing the thickness of the lines in the graphics is not only helpful for distinguishing the graphic elements, but also for accurately expressing the design intent and facilitating the recognition of the drawings. In particular, engineering drawings should be divided into obvious thicknesses according to the national drawing standards. In this way, the drawings can meet the requirements of standardization.
In fact, the thickness of the line varies from thick to thin, which is reflected in the line width value of the line in the computer graphics file. For example, the outer contour lines, graphic symbols and table outlines of each entity in the drawing are thick lines, and the section lines, dimension (boundary) lines, symbol leaders, center lines, and dash-dot lines should be thin lines, and The dotted line is between the thick and thin lines. And thick, medium and thin lines can also change the line width within a certain range as needed. Usually designers or drawing staff use AutoCAD drawing software on their computers, they often use group drawing commands like COPY, OFFSET, MIRROR, etc. In order to improve the efficiency of drawing, the thickness of the line and the type of line are not taken into account in the group drawing. Instead, we will adjust and solve this problem at the end of the drawing. Because there are many pixels in the picture at this time, it is very complicated and time-consuming to adjust by interactive operation commands, and other methods are difficult to solve the problem satisfactorily. In this way, it is necessary to provide a convenient tool in addition to the interactive operation function of AUTOCAD, so that it can complete this work conveniently and quickly to achieve the purpose of fast, accurate, efficient and comprehensive. Ensure that the graphical view on the screen is clear and distinct.
Generally speaking, there are two ways to adjust the line width in graphics: one method is to place lines with different line widths in layers when drawing, or to set different colors according to different thicknesses, and then use pen or high-end inkjet The line width setting parameters of the plotter are adjusted to obtain the required hard copy drawings. The disadvantage of this method is that the output device requirements are high, and the parameter setting of the drawing device must be skilled. However, people cannot see the real effect of the drawings after output on the screen. Moreover, when designers draw graphics, the layering and color separation management considered cannot be based solely on the width of the lines. When the pixels in the same layer and color have different line widths due to line type and structure, they have to be adjusted one by one. This will make the task of setting the line width of the output drawing very complicated.
The second method is that under any graphics output device (plotter, printer, photography, photographic production equipment), the graphics to be output are explicitly adjusted on the screen for the thickness of each pixel line, and then Output. What you see on this screen is a true reflection of what you get. And it is not necessary to adjust the parameters of the output device and the line width changes, and there is no special requirement for the output device. This is of practical significance in the current situation where a large number of ordinary printers are used to produce pictures due to the high price of high-end plotters.
This article introduces a small AutoLISP program written for this purpose, so that the operator can complete the adjustment of the thickness of the pixel lines in the graph in a very convenient and fast way.
The types of lines that the program can handle include straight lines, polylines, circles (arcs), ellipses (arcs), and spline curves. Line types can handle solid lines, dashed lines, center lines, dash-dot lines, and boundary lines. The operator can call the program to run at any time in the interactive state to complete the adjustment of the line thickness in the current graphic.
In order to facilitate operation and improve the efficiency of pixel selection, the program has designed several implementations of the line width adjustment process. But in any way, you must first determine the required adjustment range (including: layer, color, line type). If the line width of pixels on a layer does not need to be adjusted or has been adjusted, you can first turn it off to narrow down the selection.
The following is the specific operation process in three ways:
1. Select pixel adjustment:
1) Mode selection [Select \ ayer \ Color \ LType] answer S (Select)
2) Select the pixel range of the adjusted line width 3) Give a new line width value 4) Automatically complete the adjustment of all the pixel line widths included in the selected range according to the new line width value
1) Choose the way to answer L (Layer)
2) Select the range of set pixels (can be all or part)
3) In [EnTIty \ Name], you can choose two methods to determine the layer name. Answer E, you can select a pixel from the picture, based on the layer name of the layer where the pixel is located; answer N, you need to type the layer name of the adjustment layer 4) Give a new line width value 5) Press the new The line width value is automatically adjusted on the determined layer on the determined pixel line width within the selected range.
1) Answer C (Color)
2) Select the range of adjustment effect 3) In [EnTIty \ Number], two methods can be used to determine the color. Answer E, you can choose a pixel whose color is the same as the desired adjustment color: Answer N will give the number of the adjustment color you want 4) Given the new line width value 5) The program will use the new line width value, based on The selected color automatically adjusts the line width of the color matching pixels within the determined range of action. 4. Adjust according to the line type:
1) Mode selection answer LT (LType)
2) Select the scope of adjustment. 3) Answer [E] in [EnTIty \ Name] to select a line-matching pixel from the graph; answer N gives [ConTInuous \ Denter \ Center \ Phantom \ DIvide \ Hidden \ DOt \ DAshdot \ Border] capital letters in front of any type of English name 4) Given a new line width value 5) The program automatically falls within the determined range of action according to the selected line type according to the new line width value Some instructions for adjusting the line width of pixels:
1 The program has no effect on selected lines such as hatching, dimension lines, extension lines, text, and symbols. When determining the selection setting range in this way, it is not necessary to consider the changes of these pixels.
2 The program cannot adjust the pixels in the block. If you need to adjust, first explode the elements in the block. If you want to keep the original graphic file structure, the graphic file after adjusting the line width can overwrite the original graphic file without saving.
3 There are various methods such as window selection method and one-by-one selection for selection. You can also use SHIFT + to select the selected pixels.
4 All the pixels that change the line width, except for the thickness change, other attributes (such as: layer, color, line type) will not change.
5 If the color or line type value of the pixels in the original layer is based on YLAYER to learn J * Chang Fan * (drawing),
Then these pixels do not belong to the pixels within the scope of the program when the line width is adjusted by Color or LType. Nor can we use these factors as a basis in the above two ways to select entities to determine the color and line type. This will prompt you when encountering such situations during the program running. In this case, it can be considered to preferentially select (Select) or layered (Layer) to adjust. Because the pixels that can be adjusted by color or line type are those determined by the COLOR command or the SET LINETYPE command, no matter which layer the pixels are in, they can be automatically searched and adjusted.
6 This program is suitable for AUTOCAD R12 version. There are three methods to deal with the variable line width of the pixel circle in the graphics file in this version: one is to cut at a certain point to make it become a closed arc for processing; the second is to draw a closed arc of the same size first and then eliminate the original The circle; three is replaced by the ring formed by DNOUT. Here is the second method. If the graphics are drawn in AUTOCAD R13 version, similar measures must be taken for the ellipse.
Source program chwd.lsp
(defun c: width ()
(setq bb 1)
(setq w 0)
(initget 1 "Select Layer Color LType")
(prompt "Adjustment mode selection")
(setq t (getkword "[Select \\ Layer \\ Color \\ LType"))]
(prompt "select adjustment range")
(setq obj (ssget))
(if (= t "Layer")
(progn
(initget 1 "Entity Name")
(prompt "Select the entity to determine the layer or give the layer name?")
(setq 1b (getkword "[Entity \\ Name]:"))
(if (= 1b "Entity")
(progn
(prompt "Select the desired change layer pixels:")
(setq 1e (ssget)
(setq 1p (ssname le 0))
(setq 11 (cdr (car (cdr (cdr (entget 1p))))))
)
)
(if (= 1b "Name")
(progn
(setq 111 (getstring "Give the layer name you need to change:"))
(setq 11 (strcase 111))
)
)
(setq obj1 (ssadd))
(setq j 0)
(while ( (setq pl (ssname obj j))
(setq j (+ j 1))
(setq py (cdr (car (cdr (cdr (entget pl))))))
(if (= ll py)
(ssadd pl obj1)
)
)
)
)
(if (= t "Color")
(progn
(initget 1 "Entity Number")
(prompt "Select the entity to determine the color or give the color number")
(setq lb (getkword "[Entity \\ Number]:"))
(if (= lb "Entity")
(progn
(prompt "Select the entity to determine the color of the line width pixels needed:")
(setq le (ssget))
(setq lp (ssname le 0))
(setq lc (car (car (cdr (cdr (cdr (entget lp)))))))
(if (= lc 62)
(setg 11 (cdr (cdr (cdr (cdr (cdr (cdr (cdr (entget lp)))))))
)
(if (= 1c 66)
(progn
(prompt "The color of the entity is determined with the layer (Bylayer)!")
(setq bb 0)
(setq kk (getstring "terminate the process?"))
)
)
(if (= lc 6)
(setq ll (cdr (car (cdr (cdr (cdr (cdr (cdr (entget lp))))))))
)
)
(if (= lb "Number")
(setq ll (getstring "Give color number:"))
)
)
(setq objl (ssadd))
(setq j 0)
(while ( (setq pl (ssname obj j))
(setq j (+ j 1))
(setq pc (cdr (car (cdr (cdr (cdr (entget pl)))))))
(setq lcc (car (car (cdr (cdr (cdr (cdr (entget pl)))))))
(if (= lcc 6)
(setq pc (cdr (car (cdr (cdr (cdr (cdr (cdr (entget pl))))))))
)
(if (= ll pc)
(ssadd pl obj1)
)
)
)
)
(if (= t "LType")
(progn
(initget 1 "Entity Name")
(prompt "Select the entity to determine the line type or give the line type name")
(setq lb (getkword "[Entity \\ Name]:"))
(if (= lb "Entity")
(progn
(prompt "Select the line type entity to determine the line type of the required line width pixels:")
(setq le (ssget))
(setq lp (ssname le 0))
(setq lc (car (car (cdr (cdr (cdr (cdr (entget lp)))))))
(if (= lc 6)
(setq ll (cdr (car (cdr (cdr (cdr (entget lp)))))))
)
(if (/ = lc 6)
(progn
(prompt "The color of the entity is determined by the layer (Bylayer)!")
(setq bb 0)
(setq kk (getstring "terminate process?"))
)
)
)
)
(if (= lb "Name")
(progn
(initget 1 "Continuous Dashed Center Phantom DIvide Hidden DOt DAshdot Borde
r ")
(prompt "Give a line name that needs to be changed?")
(setq lll (getkword "[Continuous \\ Dashed \\ Center \\ Phantom \\ DIvid
e \\ Hidden \\ DOt \\ DAshdot \\ Border] "))
(setq ll (strcse lll))
)
)
(setq objl (ssadd))
(setq j 0)
(while ( (setq pl (ssname obj j))
(setq j (+ j 1))
(setq pc (cdr (car (cdr (cdr (cdr (entr pl))))))
(if (= ll pc)
(ssadd pl objl)
)
)
)
)
(if (= bb 1)
(progn
(setq cpp (ssadd))
(setq w (getreal "given a new line width value [0.00]:"))
(setq i 0)
(setq ii (sslength obj))
(if (/ = t "Select")
(setq ii (sslength objl))
)
(while ( (setq p (ssname obj i))
(if (/ = t "Select")
(setq p (ssname objl i))
)
(setq py (cdr (car (cdr (cdr (entget p))))))
(setq i (+ il))
(setq objent (cdr (car (cdr (entget p)))))
(setq pp (cdddr (entget p)))
(if (= t "color")
(setq pp (cdr (cdddr (entget p))))
)
(if (= t "LType")
(setq pp (cdr (cdddr (entget p))))
)
(if (= objent "LINE")
(command "pedit" p "y" "w" w "")
(if (= objent "POLYLINE")
(command "pedit" p "w" w "")
(if (= objent "CIRCLE")
(progn
(setq p0 (cdar pp))
(setq r (cdadr pp))
(setq pl (polar p0 0.0 r))
(setq and 359.99)
(command "layer" "s" py "")
(if (= t "Color")
(command "color" ll)
)
(command "pline" pl "w" ww "a" "ce" p0 "a" and "")
(ssadd p cpp)
)
(if (= objent "ARC")
(command "pedit" p "" "w" w "")
)
)
)
)
)
(command "erase" cpp "")
(command "redraw")
)
)
)

RAM/RFM electric heating capacitors

RAM/RFM electric heating capacitors

Electric Heating Capacitor,Film Heating Capacitor,Electric Capacitor Bank,Induction Heating Capacitors

YANGZHOU POSITIONING TECH CO., LTD , https://www.yzpstcc.com