Research on Key Technologies of Component-Based 3D CAD System Development (3)

2 .3 Marking along the curve
In the design, it will encounter the problem of marking along a given curve, such as the marking of the excavation line symbol along the excavation contour in the floor plan. The rock symbol in the section view is marked along the contour line, the point is marked, and the Chinese character is along any curve. Label and so on. Such problems are mainly solved by using AutoCAD's Measure or divide commands. The main difference between the two commands is that the former is marked on the curve by the specified length, and the latter is equally divided by the given number of segments and marked at the bisector. It is best to use the pline line to mark the contour curve. The symbol to be marked is pre-made into a tile. The block uses a unit block. Execute the measure or divide command, select the curve to be labeled, specify the label symbol, segment length or number of segments. The annotation can be completed. When the symbol of the annotation is too dense or too sparse, you can execute the erase command to select P to delete. The proportion is not suitable or the direction of the symbol is not correct. You can use the property editor to select all the annotation symbols and the annotation symbols. Adjust the scale and rotation angle until you are satisfied. For more advanced applications, an LSP program can be programmed to mark symbols and text along any curve.

2 .4 form generation
AutoCAD itself does not have a table processing function. The engineering scales, steel bars, etc. in the design drawings involve the generation of tables. The following methods can be used:

(1) directly paste the form in the Word or Excel file directly into the CAD drawing. Just double-click the form in the drawing to enter the Word or Excel for editing and editing. After the modification is completed, you can return to AutoCAD and continue. Design, the advantages of this method is convenient, fast, easy to master, and can make full use of Excel's powerful computing functions. The disadvantage is that the table is not a normal primitive in AutoCAD. It is not possible to edit the height, color and line width of the table using the CAD function.

(2) Prepare the LSP program, and input the table title, the number of table rows, the number of table columns, the table row height and the column width, and the table insertion point, etc., and the table can be automatically generated. The text has been filled in the form of Excel. You can use the word processing software to edit and modify the text in the form.

(defun C:mtab()

(setq tb1 nil tb2 nil tb3 nil)

(setq rows (getint "table rows"))

(setq cols (getint "table column number"))

(setq rowh (getreal "row height"))

(setq colw (getreal "column width"))

(setq p1 (getpoint "/n table top left position:"))

(command "pline" p1 "w" "0.5" "0.5"

(setq p2 (list (+ (car p1) (* cols colw)) (cadr p1)))

(setq p4 (list (car p2) (- (cadr p2) (* rows rowh))))

(setq p3 (list (car p1) (- (cadr p2) (* rows rowh))))

"C" )

(setq n 1)

(while (< n rows); draw horizontal line table
(command "pline" (list (car p1) (- (cadr p1) (* n rowh))) "w" "0" "0"

(list (car p2) (- (cadr p2) (* rowh n))) "")

(setq n (+ n 1))

)

(setq n 1)

(while (< n cols) ; draw vertical table lines
(command "pline" (list (+ (car p1) (* n colw)) (cadr p1)) "w" "0" "0" (list (+ (car p1) (* n colw)) (cadr p3 ))

"")

(setq n (+ n 1))

)

(command "text" "m" (list (+ (car p1) (* 0.5 cols colw))

(+ (cadr p1) 5)) "3" "0" "TITLE" )

(setq n 0)

(while (< n rows)

(setq m 0)

(while (< m cols)

(cond

((< m 26) (setq bzstr (chr (+ 65 m))))

((>= m 26) (setq bzstr (strcat (ch 64 (/ m 26))) (chr (+ 65 (- m (* 26 (/ m 26)))))))))

)

(command "text" "m" (list (+ (car p1) (* 0.5 colw) (* m colw));
(- (cadr p1) (* 0.5 rowh) (* n rowh)))

(getvar"TEXTSIZE") "0" (strcat bzstr (ito a (+ n 1))))

(setq m (+ m 1))

)

(setq n (+ n 1))

))

2 .6 elevation decimal digit processing
Dimensioning the number of decimal places is easy to adjust, but it is very difficult to adjust the numbers in the table and the table. It is very convenient to adjust the LSP program. Just select the number to be adjusted and input the number of decimal places to be retained according to the prompt. Modify all selected numbers.

(defun entsgc()

(setq n 0)

(setq sh (sslength e1))

(while (< n sh) (setq x (entget (ssname e1 n)))

(if (= (fld 0 x) "TEXT")

(progn

(setq agc (fld 1 x))

(setq c (substr agc 1 1))

(if (or c=+") (= c "-") (and (>= c "0") (<= c "9")))

(progn

(if (or c=+") (= c "-"))

(setq bgc (substr agc 2))

(setq bgc agc)

)

(setq cgc (atof bgc))

(setq zh (rtos cgc 2 gcws))

(if (or c=+") (= c "-"))

(setq zh (strcat c zh)))

(setq x (subst (cons 1 zh) (assoc 1 x) x))

(entmod x)

)

))

))

(setq n (+ n 1)))

)

(defun c:yxws()

(setq e1 (ssget))

(setvar "dimzin" 0)

(setq gcws (getint "reserved decimal places: "))

(if e1 (entsgc) (print "/n not found"))

(setq x nil)

)

Previous page next page

Dark Color Wood Floors

Dark Color Wood Floors,Waterproof Flooring,Parquet Flooring Wood,Oak Wide Plank Flooring

Shaoxing Haohua Timber Industry Co., Ltd. , https://www.woodtopiafloor.com