Jump to content

HELP!!! Autoarea Lisp Routine


cbiff101

Recommended Posts

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.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...