Jump to content

Recommended Posts

Posted

Hi All,

can anybody convert this lisp to sq.ft. now the area i am getting area in sq m.. looking for polyline area to be placed in sq ft when it selected. thank u.

PLA.LSP

Posted (edited)
4 hours ago, rose sr said:

Hi All,

can anybody convert this lisp to sq.ft. now the area i am getting area in sq m.. looking for polyline area to be placed in sq ft when it selected. thank u.

PLA.LSP 1.64 kB · 3 downloads

;
; Select closed polyline and place mtext with the room name and Area in ft2
;
; How to use:
; 	1. select polyline
;	2. type in room name
;		Note: the getstring function does not allow spaces, so use a _ underscore to seperate words
;	3  select insert point
;	4  Something similar to this will be placed with MTEXT
;		room_name
;		Area: 111.11 ft2
;	5  MTEXT will be placed with no wrap, to current settings
;
; Created	
; 11-June-2003	YZ 	
;	This code was taken from an internet web site. the original author was 'Jos van Doorn'. 
;	Among other things, I have modified the program to use MTEXT.
;		

(defun drtxt_ft (/ rn tx ls vl lt ht lb hb nr pt)
  (setq tx (strcat "Area: " 
	   (rtos (* (/ (getvar "area") 1000000) 10.7639) 2 2) 
	   " ft\U+00B2"
	   )  	   
	   rn (getstring "\nRoom Name: ")
  )
  (setq ls (list (cons 1 tx))
  	vl (textbox ls)
  	vl (cadr vl)
  	lt (car vl)
  	ht (cadr vl)
  	vl (grread T)
  	nr (car vl)
  	pt (cadr vl)
  )
  (princ "\nInsert Point: ")
  (while (/= nr 3)
    (command "redraw")
    (grdraw pt (setq pt (polar pt 0 lt)) 7)
    (grdraw pt (setq pt (polar pt (* pi 0.5) ht)) 7)
    (grdraw pt (setq pt (polar pt pi lt)) 7)
    (grdraw pt (polar pt (* pi 1.5) ht) 7)
    (setq vl (grread T)
	  nr (car vl)
	  pt (cadr vl)
    )
    ) ;end while function
  (command "-mtext" pt "w" 0 rn tx "")
  (redraw)
) ; end drtxt function

(defun c:plaft ( / et)
  (setvar "cmdecho" 0)
  (while (setq et 
	   (car 
    	     (entsel "\nSelect polyline: ")
  	   ) ;end car function
	 ) ;end setq function
  (command "area" "o" et)
  (drtxt_ft)
  ) ; wnd while funtion

(setvar "cmdecho" 1)
(princ)

) ; end c:plaft function

 

like this?

Edited by exceed

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