Jump to content

Recommended Posts

Posted

could some one help me get code to write perimeter also

 
;;                         SQFT Area Lisp Program
;;                          Ghostrider @ Cadtutor     
;;                      WRITTEN:November 11, 1994

(defun c:SQ2 (/    P1  P2    P3    P4    P5  P6    A     B
     C    D  E     F     PT    PTLIST      OS    ss
     ssl   wl  ctr   l1    l2    wn  wlist llist vlist
     bn    dlist dllist      dvlist
    )
 (setvar "CMDECHO" 0)
 (setq wl 0)
 (setq E 0)
 (setq D 0)
 (setq OS (getvar "OSMODE"))
   (setq l1 70)
 (setvar "OSMODE" 32)
 (while (/= nil
     (setq PT
     (getpoint
       "\nPick a room corner point, press return when done: _int "
     )
     )
     (progn
       (if PT
  (/= nil (setvar "lastpoint" PT))
       )
       (setq PTLIST (cons PT PTLIST))
     )
 )
 )
 (setq PTLIST (reverse PTLIST))
 (setvar "OSMODE" 0)
 (command "PLINE")
 (while (/= nil
     (car PTLIST)
     (progn
       (command (car PTLIST))
       (setq PTLIST (cdr PTLIST))
     )
 )
 )
 (command "AREA" "e" "l" "ERASE" "l" "")
 (setvar "OSMODE" OS)
 (command "redraw")
 (setq A (/ (getvar "area") 144))

 (setq P1 (getpoint "\nPick center point of text: "))
 (setq P2 (list (car P1) (- (cadr P1) 5)))
 (setq P3 (list (car P1) (- (cadr P2) 5)))
 (setq P4 (list (car P1) (- (cadr P3) 5)))
 (setq P5 (list (car P1) (- (cadr P4) 5)))
 (setq P6 (list (car P1) (- (cadr P5) 5)))
 (command "text" "c" P1 6 0 (strcat (rtos A 2 2) " SQFT."))
 (setvar "cmdecho" 1)
 (princ)
 ); end of c:SQ2
(princ "\n*** Type SQ2 to add sq root of room *** ")


Posted

i tried this but text is on top of each other as well as wrong in- formation must be cause im frencho:)

 
(command "AREA" "e" "l" "ERASE" "l" "")
 (setvar "OSMODE" OS)
 (command "redraw")
 (setq A (getvar "perimeter") 

(setq P1 (getpoint "\nPick center point of text: "))
 (setq P2 (list (car P1) (- (cadr P1) 5)))
 (setq P3 (list (car P1) (- (cadr P2) 5)))
 (setq P4 (list (car P1) (- (cadr P3) 5)))
 (setq P5 (list (car P1) (- (cadr P4) 5)))
 (setq P6 (list (car P1) (- (cadr P5) 5)))
 (command "text" "c" P1 6 0 (strcat (rtos A 2 2) " perimeter."))
 (setvar "cmdecho" 1)
 (princ)

Posted

Defun C: areaw()

(setq Q1 (getreal "\n user enter data for Q1: ")

( * Q1 144)

(setq W1 (getreal "\n user enter data for Q1: ")

( * W1 144)

( + Q1 W1)\setq P1 (getpoint "\nPick center point of text: "))

(setq P2 (list (car P1) (- (cadr P1) 5)))

(setq P3 (list (car P1) (- (cadr P2) 5)))

(setq P4 (list (car P1) (- (cadr P3) 5)))

(setq P5 (list (car P1) (- (cadr P4) 5)))

(setq P6 (list (car P1) (- (cadr P5) 5)))

(command "text" "c" P1 6 0 (strcat (rtos A 2 2) " SQFT."))

(setvar "cmdecho" 1)

(princ)

lisp.JPG

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