Community
;DA.LSP Program calculates polyline areas and inserts a hexagon which fills in ;calculated area (in acres) and prompts for coefficient and structure number. Useful for ;drainage area maps. Make sure to modify appropriate path after "insert" command below. (defun c:DA() (princ "Select Polyline for Area") (COMMAND "AREA" "O" pause) (SETQ AREA1 (rtos (/ ( GETVAR "AREA") 43560.0) 2 2)) (print "The area in acres is")(terpri)(print area1)(terpri) (COMMAND "INSERT" "DAREA" "S" "40" PAUSE "" "" AREA1 " ") (PRINC) )
Here is a simple LISP file that works fine in 2013 but does not in 2015. In 2013 it will populate the field AREA and insert the block. In 2015, it does not and brings up the dialoge box for input instead. Any ideas?
Thanks
Randy
Solved! Go to Solution.
Solved by rkmcswain. Go to Solution.
Try this:
(defun c:DA (/ AREA1) (setvar "qaflags" 0) (setvar "attdia" 0) (setvar "attreq" 1) (princ "Select Polyline for Area") (COMMAND "AREA" "O" pause) (SETQ AREA1 (rtos (/ ( GETVAR "AREA") 43560.0) 2 2)) (print "The area in acres is")(terpri)(print area1)(terpri) (COMMAND "INSERT" "DAREA" "S" "40" PAUSE "" "" AREA1 " ") (PRINC) )