Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Lisp no longer populates area field

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
rrandolph
298 Views, 2 Replies

Lisp no longer populates area field

;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

2 REPLIES 2
Message 2 of 3
rkmcswain
in reply to: rrandolph

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)
 )

 

R.K. McSwain     | CADpanacea | on twitter
Message 3 of 3
rrandolph
in reply to: rkmcswain

Thanks that did the trick.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost