0% found this document useful (0 votes)
23 views2 pages

CS Area

Uploaded by

bravomikeparle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views2 pages

CS Area

Uploaded by

bravomikeparle
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

(defun c:CF()

(setq filed(open "D:\\Cut Fill Area.xls" "a"))


(command "Layer" "off" "Center_Line" "")
(setvar "cmdecho" 0)
(setq os(getvar "osmode"))
(setvar "osmode" 0)
(setq cl(getvar "clayer"))
(vl-load-com)
(setq chainage(entget(car(entsel "\nSelect the text containing chainage\n"))))
(setq ChObj(cdr(assoc '-1 chainage)) ChPoint(cdr(assoc '10 chainage)))
(setq chval(cdr(assoc '1 chainage)))
(setq CP (getpoint "\nEnter the point inside cutting area:"))
(cond((eq CP nil)(setq CArea "0"))
((/= CP nil)
(command "Boundary" CP "")
(setq Ent1 (entlast))
(setq Vla_EntL1 (vlax-ename->vla-object Ent1))
(setq CArea (rtos (vla-get-area Vla_EntL1) 2 3))
(entdel Ent1)
)
);cond
(setq FP(getpoint "\nPick the Point inside the filling area"))
(cond((eq FP nil)(setq FArea "0"))
((/= FP nil)
(command "Boundary" FP "")
(setq Ent2 (entlast))
(setq Vla_EntL2 (vlax-ename->vla-object Ent2))
(setq FArea (rtos (vla-get-area Vla_EntL2) 2 3))
(entdel Ent2)
)
);cond
(setq ChArea(strcat chval "\t" CArea "\t" FArea))
(write-line ChArea filed)
(close filed)
(command "Erase" ChObj "")
(Chainage_layer)
(command "text" chPoint "" "0" chval )
(command "change" "l" "" "p" "la" "Chainage" "")
(Cut_layer)
(command "text" "" (strcat "Cutting Area : " CArea " Sqm"))
(command "change" "l" "" "p" "la" "CUT" "")
(Fill_layer)
(command "text" "" (strcat "Filling Area : " FArea " Sqm"))
(command "change" "l" "" "p" "la" "FILL" "")
(setvar "cmdecho" 1)
(setvar "osmode" os)
(command "layer" "s" cl "" "")
(princ "")
(command "layer" "on" "Center_Line" "")
(prompt (strcat "Chainage : " chval "--> Cut : " CArea "-->Fill : " FArea))
;prompt to screen
) ;_ defun

(defun Cut_layer()
(if
(eq (tblsearch "layer" "CUT") nil)
(command "layer" "n" "CUT" "c" "50" "CUT" "s" "CUT" "")
)
);defun
(defun Fill_layer()
(if
(eq (tblsearch "layer" "FILL") nil)
(command "layer" "n" "FILL" "c" "10" "FILL" "s" "FILL" "")
)
);defun
(defun Chainage_layer()
(if
(eq (tblsearch "layer" "Chainage") nil)
(command "layer" "n" "Chainage" "c" "3" "Chainage" "s" "Chainage" "")
)
);defun

You might also like