Jump to content

Area lisp not working in AutoCAD 2015


MK2015

Recommended Posts

Can anyone make this work in AutoCAD Map3D 2015 release?

It has worked fine in all previous versions of AutoCAD Map3D, prior to 2015.

 

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

Edited by rkmcswain
added [CODE] tags
Link to comment
Share on other sites

I don't know LISP at all, but I found and replaced "command" with "command-s" and that made no difference. I don't know anything about VL-cmdf... :(

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