Area Lsp

Status
Not open for further replies.

Andy Roberts

Usenet Archive
Joined
Sep 23, 2000
Messages
28
Reaction score
0
Does anyone have a lisp routine for clicking on a polyline and placing the area of the polyline as text

Can you please post it?
Regards
Andy

Andy Roberts
Arena Property Services
London
United Kingdom

0207 8377721
 
(defun c:pa (/ pt) ;; PrintArea
(setvar "cmdecho" 0)
(princ "\nPick a polyline: ")
(command "_area" "_o" pause)
(setq pt (getpoint "\nPick a point to insert the text: ")) (command "_text" pt "" "" (getvar "area")) (princ)
)

HTH
Juergen

Andy Roberts wrote:

Does anyone have a lisp routine for clicking on a polyline and placing the area of the polyline as text

Can you please post it?
Regards

Andy

Andy Roberts
Arena Property Services
...
 
Andy,

Just a follow up to the useful routine that Juergen posted:

Use the rtos function to control the output of the text.

Example:
(command "_text" pt "" "" (getvar "area"))
If your units are set to decimal, the output will give you more decimal places than you probably need.

To control this, change the line to:
(command "_text" pt "" "" (rtos (getvar "area") 2 4))

This example will give you 4 decimal places. The 2 represents the mode of units (decimal in this case); the 4 represents the precision. You can omit these two numbers if you want to use your current settings in UNITS or you can output them in any units you'd like. For more info, see RTOS function in Autolisp Help.

Pete
Andy Roberts wrote:
Does anyone have a lisp routine for clicking on a polyline and placing the area of the polyline as text

Can you please post it?
Regards
Andy

Andy Roberts
Arena Property Services
London
United Kingdom

0207 8377721
 
Thanks all
"Pete" wrote:
Andy,

Just a follow up to the useful routine that Juergen posted:

Use the rtos function to control the output of the text.

Example:
(command "_text" pt "" "" (getvar "area"))
If your units are set to decimal, the output will give you more decimal places than you probably need.

To control this, change the line to:
(command "_text" pt "" "" (rtos (getvar "area") 2 4))

This example will give you 4 decimal places. The 2 represents the mode of units (decimal in this case); the 4 represents the precision. You can omit these two numbers if you want to use your current settings in UNITS or you can output them in any units you'd like. For more info, see RTOS function in Autolisp Help.

Pete
Andy Roberts wrote:
Does anyone have a lisp routine for clicking on a polyline and placing the area of the polyline as text

Can you please post it?
Regards
Andy

Andy Roberts
Arena Property Services
London
United Kingdom

0207 8377721
 
Download autolisp utility insarea at link

http://space.tin.it/edicola/lwcon/autolisp/autolisp.htm

clicking on a polyline or countur and placing the area of the polyline as text.

David
 
I hope this is what you want

(defun c:are_e
(menucmd "s=apos")
(setq h (getreal "n\DWSE TO YPSOS:"))
(SETQ OLDOSMODE(GETVAR "OSMODE"))
(SETVAR "OSMODE" 512)
(setq p1 (getpoint "n\Pick a polyline:"))
(command "area" "e" p1)
(setq em (getvar "area"))
(setq p (getpoint "\nPick a point for print :"))
(command "text" "s" "standard" p h "0" (rtos em 2 2)) (SETVAR "OSMODE" OLDOSMODE)
)

Jim
? "Andy Roberts" ???a?e st? ???a

Does anyone have a lisp routine for clicking on a polyline and placing the area of the polyline as text

Can you please post it?
Regards
Andy
Andy Roberts
Arena Property Services
London
United Kingdom

0207 8377721
 
Status
Not open for further replies.

Latest threads

Back
Top