I think this script works better...
;;; Adapted from 'getarea.lsp by Omura Illustration (C) 1995 by Bill DeShawn
& are_e.lsp by
;;; Jim (dedalos_2000@hotmail.com). Further, tiny
;;; modifications by Zac Carey (ZJC), 2002.
;;; Program to simultaneously place metric and imperial area information in
a drawing.
;;; Make sure that the the block 'areaz.dwg' is located in the support
directory.
;;; This block should contain, as a minimum, two attribute definitions, for
metric and
;;; imperial data which, when writing the block, should be selected in that
order.
;;; Ideally, each of these attribute definitions should be on different, and
readily,
;;; identifiable layers. My block contains a third attribute definition for
specifying the
;;; function that the given area is to be used for - and a fourth for
specifying the floor
;;; no. or no. of floors to which the area data pertains. This is expressly
for the purpose
;;; of exporting the area data to a spreadsheet.
;;; If you create a block with only two attribute definitions then the line;
;;; (command "insert" "areaz" pt sc "" "" ar mar "" "")
;;; should read
;;; (command "insert" "areaz" pt sc "" "" ar mar )
;;; To use, the area must first have a polyline outline
;;; Start plarea, then pick the polyline. Next, pick a point at which
;;; to locate the note. The area is then displayed in square metres and
square feet.
(defun plareaerr ()
(setvar "cmdecho" 1)
(print "ERROR - Command aborted")
(command "_.undo" "_end")
)
(defun c:plarea (/ a ar mar pt sc pt1)
(command "_.undo" "_g")
(setq *error* olderr *error* plareaerr)
(setvar "cmdecho" 0)
(setq sc (getvar "dimscale"))
(setq os1 (getvar "osmode"))
(setvar "osmode" 512)
(setq pt1 (getpoint "Pick a closed polyline: "))
(command "area" "e" pt1)
(setq ar (getvar "area"))
(setq ar (/ ar 1000000))
(setq mar (strcat (rtos (* ar 10.7639104) 2 0)))
(setq ar (strcat (rtos ar 2 1)))
(setq pt (getpoint "select location for area note: "))
(command "insert" "areaz" pt sc "" "" ar mar "" "" "" )
(setvar "osmode" os1)
(setq *error* olderr)
(command "_.undo" "_end")
)
"laptop" wrote in message
news:5070128@discussion.autodesk.com...
Sorry, there seems to be a couple of lines missing.
There needs to be some statements added to get the current OSMODE, store it,
and then change the OSMODE to 512, and then back to the old OSMODE at the
end of the routine. I have a version somewhere with these lines coorectly
inserted which I'll post tomorrow - if I remember!.
In the meantime, this is almost right(I think)...
;;; Adapted from 'getarea.lsp by Omura Illustration (C) 1995 by Bill DeShawn
& are_e.lsp by
;;; Jim (dedalos_2000@hotmail.com). Further, tiny
;;; modifications by Zac Carey (ZJC), 2002.
;;; Program to simultaneously place metric and imperial area information in
a drawing.
;;; Make sure that the the block 'areaz.dwg' is located in the support
directory.
;;; This block should contain, as a minimum, two attribute definitions, for
metric and
;;; imperial data which, when writing the block, should be selected in that
order.
;;; Ideally, each of these attribute definitions should be on different, and
readily,
;;; identifiable layers. My block contains a third attribute definition for
specifying the
;;; function that the given area is to be used for - and a fourth for
specifying the floor
;;; no. or no. of floors to which the area data pertains. This is expressly
for the purpose
;;; of exporting the area data to a spreadsheet.
;;; If you create a block with only two attribute definitions then the line;
;;; (command "insert" "areaz" pt sc "" "" ar mar "" "")
;;; should read
;;; (command "insert" "areaz" pt sc "" "" ar mar )
;;; To use, the area must first have a polyline outline
;;; Start plarea, then pick the polyline. Next, pick a point at which
;;; to locate the note. The area is then displayed in square metres and
square feet.
(defun plareaerr ()
(setvar "cmdecho" 1)
(print "ERROR - Command aborted")
(command "_.undo" "_end")
)
(defun c:plarea (/ a ar mar pt sc pt1)
(command "_.undo" "_g")
(setq *error* olderr *error* plareaerr)
(setvar "cmdecho" 0)
(setq osmode (getvar "osmode"))
(setvar "osmode" 512)
(setq sc (getvar "dimscale"))
(setq pt1 (getpoint "Pick a closed polyline: "))
(command "area" "e" pt1)
(setq ar (getvar "area"))
(setq ar (/ ar 1000000))
(setq mar (strcat (rtos (* ar 10.7639104) 2 0)))
(setq ar (strcat (rtos ar 2 1)))
(setq pt (getpoint "select location for area note: "))
(command "insert" "areaz" pt sc "" "" ar mar "" "")
(setq *error* olderr)
(setvar "osmode" osmode)
(command "_.undo" "_end")
)
wrote in message news:5070105@discussion.autodesk.com...
Thanks for the help. I seen to be having some troubles though. When the lisp
routine asks me to pick a Pline I can't select one. It is like autocad is
not in the select mode.
Any ideas?
Also anyway to just tag all the plines at once?