cbiff101 Posted January 26, 2015 Share Posted January 26, 2015 Hi Everyone, I am pretty new to lisp routines and the codes so I was wondering if anybody could help me figure out why my autoarea.lsp will not work in AutoCAD map 2015. This is the routine I am using: Code: ;;This program will calculate the area of irregular polygons ;;by picking an area inside the polygon. (defun C:AUTOAREA (/ ar en n num pt ss1) (if (not "acadapp.exp")(xload "acadapp.exp")) (setq n 0) (setq ss1 (ssadd)) (while (setq pt (getpoint "\nSelect internal point:")) (bpoly pt) ;;ADS function (setq ss1 (ssadd (entlast) ss1)) );;while (setq num (sslength ss1)) (command "area" "A" "E") (while (/= num n) (setq en (ssname ss1 n)) (command en) (setq n (1+ n)) );;while (command "" "") (command "erase" ss1 "") (command "redraw") (princ "\nThe area of the polygon in Square Meters is: ") (princ (cvunit (setq ar (getvar "AREA")) "SQ METER" "SQ METER")) (princ "\nThe area of the polygon in Square Feet is: ") (princ (cvunit (setq ar (getvar "AREA")) "SQ METER" "SQ FEET")) (princ "\nThe area of the polygon in hectares is: ") (princ (cvunit (setq ar (getvar "AREA")) "SQ METER" "HECTARE")) (princ "\nThe area of the polygon in acres is: ") (princ (cvunit (setq ar (getvar "AREA")) "SQ METER" "ACRE")) (setq ss nil) (prin1) );;end autoarea.lsp Thanks in advance for any help into getting this routine to run again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.