AutoCAD calculation geological interface production profile cross-section line program
1 Introduction <br> <br> when we draw geological profile, often painting fault. Most of the colleagues I have seen use a calculator or an Excel spreadsheet program to calculate their apparent tilt angle. The disadvantage is that the relationship between the tendency of the fault and the orientation of the section cannot be judged. When we judge the relationship between the fault tendency and the direction of the section, it is sometimes easy to make simple mistakes that are taken for granted. In order to quickly and accurately draw faults in the section view, I specially edited this program for everyone to share. It is directly in AutoCAD, without the help of other programs, it takes only a few seconds to complete the calculation of the apparent dip angle of the fault, to determine the relationship between the fault tendency and the section direction, and to draw a schematic line of its profile. The number and appearance of the fault. Next page Modern Decorative Ceiling Fans,Modern Decorative Ceiling Fan,Home Modern Ceiling Fans,Modern Ceiling Fans With Remote Jiangmen MagicPower Electrical Appliances Co.,Ltd. , https://www.mpceilingfan.com
2 source code
(defun c:yfapm (/ anga angb fanu angc pt ptt pt1 pt2 pt3 os qx ak bk efdg yy fa)
(setvar "cmdecho" 0)
(setq anga (getreal " Please enter the section direction (degrees): "))
(setq fanu (getstring " Please enter the fault number: "))
(setq angb (getreal " Please enter the fault direction (degrees): "))
(setq qx (strcase (getstring " Please enter the fault tendency (NE, NW, SE, SW, N, E, S, W): ")))
(setq angc (getreal " Please enter the fault dip (degrees): "))
(setq yxblf yxbl)
(if (null yxblf) (setq yxblf 1000))
(princ " Please enter the ratio of the X direction < ") (princ yxblf) (princ " >: ")
(setq yxbl (getreal ))
(if (null yxbl) (setq yxbl yxblf))
(setq yyblf yybl)
(if (null yyblf) (setq yyblf 1000))
(princ "Please enter the ratio in the Y direction < ") (princ yyblf) (princ " >: ")
(setq yybl (getreal ))
(if (null yybl) (setq yybl yyblf))
(setq pt (getpoint " Please specify the fault pass point: "))
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(setq ak (tan (- 90 anga)))
(setq bk (tan (- 90 angb)))
(setq e (atan (ab (/ (- ak bk) (1+ (* ak bk))))))
(setq f (angtos (atan (* (abs (sin e)) (tan angc) (/ yxbl yybl))) 0 10))
(cond
((= qx "NW") (setq d (+ angb 270)))
((= qx "SE") (setq d (+ angb 90)))
((= qx "NE") (setq d (- angb 270)))
((= qx "SW") (setq d (- angb 90)))
((= qx "N") (setq d 0))
((= qx "E") (setq d 90))
((= qx "S") (setq d 180))
((= qx "W") (setq d 270))
)
(setq g (abs (- d anga)))
(if (and (> g 90)(< g 270))
(setq yy "opposite")
(setq yy "consistent" ))
(if (or (= g 90)(= g 270))
(setq yy "parallel"))
(if (= yy "opposite")
(setq pt1 (polar pt (+ (angtof f) pi) 100))
(setq pt1 (polar pt (+ (- pi (angtof f)) pi) 100)))
(setq pt2 (polar pt1 (/ (* pi 7) 4) 5))
(setq pt3 (polar pt2 0 31))
(setq ptt (polar (polar pt2 0 1) (/ pi 2) 1))
(setq fa (strcat fanu ":" (rtos angb) "%%d" qx "∠" (rtos angc) "%%d" ))
(command "pline" pt "w" 0.3 0.3 pt1 "w" 0 0 "" "")
(command "pline" pt1 pt2 pt3 "" "")
(command "text" ptt 2.5 0 fa "" "")
(princ "pivot") (princ f) (princ "degree")
(princ ", fault tendency and section direction") (princ yy)
(setvar "osmode" os)
(prin1)
)
(defun tan (ang / nn n nabc)
(setq ang (/ (* ang pi) 180))
(setq ang (/ (sin ang) (cos ang)))
)