Tutorial: Page (1) of 1 - 09/20/01 Email this story to a friend. email article Print this page (Article printing at MyDmn.com).print page facebook

Lsp Routine for Picking Corner Points of Rooms

Ability to accommodate different arrangements, draw a pline and print the sq. ft. By Ted Elrick
A reader wrote:

Help! I need a lisp program that will allow me to pick the corner points of a room of different arrangements, draw a pline and print the sq. feet o the room in the middle of the room. I have a lisp program that will do a square or rectangle room.


In response, here is a new lsp from Ted Elrick:

Here's a lisp routine that will do what you want. If you need it further modified, like a certain number of decimal points, or you want to specify the layer that the text goes on, just let me know.


(defun C:UserLisp (/ ss ed newstr flag ptlist pt area)

(command "erase" "")

(princ

"Please select the points defining the room, when you're done, hit return"

)

(while (= flag nil)

(setq pt (getpoint))

(if (= pt nil)

(setq flag 1)

(setq ptlist (cons pt ptlist))

)

)

(command "pline")

(repeat (length ptlist)

(command (car ptlist))

(setq ptlist (cdr ptlist))

)

(command "c")

(command "area" "o" (entlast))

(setq area (getvar "area"))

(setq area (/ area 144)) ;if you do everything in inches, dividing

;by 144 here

;will get you square feet. if you're like

;me though, and you just do everything

;in feet then you don't need this line.

(princ "Please select the location of the text")

(setq pt (getpoint))

(command "-mtext" pt "@1,.01" (strcat (rtos area) "'") "")

(setq ed (entget (entlast)))

(setq ed (subst (cons 71 7) (assoc 71 ed) ed))

(entmod ed)

(princ)

)


Page: 1


Related Keywords:

HOT THREADS on DMN Forums
Content-type: text/html  Rss  Add to Google Reader or
Homepage    Add to My AOL  Add to Excite MIX  Subscribe in
NewsGator Online 
Real-Time - what users are saying - Right Now!

Our Privacy Policy --- @ Copyright, 2015 Digital Media Online, All Rights Reserved