I have a lisp routine that calculates area of Cut & Fill Areas in Roadway Cross Sections,
The only modification i want in my lisp routine is
1) Auto Hatch Cut Area (ANSI31) , Color Cyan , Scale 1 , Angle "0"
2) Auto Hatch Fill Area (ANSI31) , Color Yellow , Scale 1 , Angle "90"
3) Auto Creates Each Layer i.e Cut & Fill
Please check the below lisp routine, Thanks
Code:
(defun filling ()
(setq mom '(+ 0))
(setvar "osmode" 0)
(while (setq imtiaz
(getpoint "\n Specify Cutting segment or exit:")
)
(command "-Boundary" imtiaz "" "Area" "o" "last")
(command "erase" "last" "")
(setq iftikhar (getvar "area"))
(setq mom (append mom (list iftikhar)))
(setq fat(princ (Eval mom)))
(setq abr(rtos fat 2 3))
(setq awa(strcat "CUT=" abr " Sq.m"))
)
(setq sp (getpoint "\n Specify where to write the calculated area :"))
(command "text" sp 0.20 0 awa)
(setq awa (strcat "CUT=" "0.000" " Sq.m"))
)
(defun cutting ()
(setq mom1 '(+ 0))
(while (setq imtiaz1
(getpoint "\n Specify FILLING segment or exit:")
)
(command "-Boundary" imtiaz1 "" "Area" "o" "last")
(command "erase" "last" "")
(setq iftikhar1 (getvar "area"))
(setq mom1 (append mom1 (list iftikhar1)))
(setq fat1(princ (Eval mom1)))
(setq abr1 (rtos fat1 2 3))
(setq awa1 (strcat "FILL=" abr1 " Sq.m"))
)
(setq sp1 ( list (car sp) (- (cadr sp) 0.40)))
(command "text" sp1 0.20 0 awa1)
(setq awa1 (strcat "FILL=" "0.000" " Sq.m"))
)
(defun c:AA ()
;;;(command "zoom" "e");;;
;;;(command "insert" "xs" pause 1 1 0);;;
(filling)
(cutting)
;;;(command "zoom" "e");;;
(command "osmode" 33)
;;;(command "insert" "graph" pause 1 1 0);;;
)