Jump to content

Recommended Posts

Posted

this lisp I got it from microsurvey standard lisp.install to auto cad and using it suppose to add or subtract constant number so far I know this command for adding subtract is not working. if you guys can help me please

ADDNUM.LSP

Posted

Generally a file is protected because the author does not want their code to be made public and in most cases there is a fee to use.

 

Just search there are others out there to do the same task and they have been posted here and the code is open.

Posted

Use Lee Mac's program, although by my opinion you could drown in its capabilities , briljant never the less

 

http://www.lee-mac.com/numinc.html

 

btw just out of curiosity i did the naughty thing and believe me , the file you've posted really isn't worth it.

 

gr. Rlx

Posted

A simple one just for numbers

 

; Adds a fixed amount to a number

;(PRINC "\nTO USE JUST TYPE A2L or A2LM for multiple ")
(Alert "TO USE JUST TYPE A2L or A2LM for multiple ")


;(setvar "cmdecho" 1)
(setq olddimzin (getvar "Dimzin"))
(setvar "dimzin" 0)

(DEFUN c:A2L ()
(if (not AH:getval) (load "getval"))
(ah:getval "Enter ht adjust.." "     edit_width = 10;" "     edit_limit = 8;")
(setq v2 (Atof item))

(setq test 1)
(while (= test 1)
     (setq en1 (car (entsel "\nSelect text number:" )))
      (if (/= en1 nil)
       (progn
       (setq el1 (entget en1))
       (setq v1 (atof (cdr (assoc 1 el1))))
       (setq a (+ v1 v2))
       (setq b (rtos a 2 3))
       (setq el (subst (cons 1 b) (assoc 1 el1) el1))
       (entmod el)
;        (entupd en1)
       );progn
      (princ "\nplease pick again"); else
    );if
); while true
(setq el nil)
(setq en nil)
(setq a nil)
(setq v1 nil)

(setvar "cmdecho" 1)
(setvar "dimzin" olddimzin)
(princ)
); END a2l DEFUN

(defun c:A2LM ()
(if (not AH:getval) (load "getval"))
(ah:getval "Enter ht adjust.." "     edit_width = 10;" "     edit_limit = 8;")
(setq v2 (Atof item))
(setq ss (ssget (list (cons 0 "Text"))))
(setq len (sslength ss))
(setq x 0)

(repeat len
(setq en1 (ssname ss x))
       (setq el1 (entget en1))
       (setq v1 (atof (cdr (assoc 1 el1))))
       (setq a (+ v1 v2))
       (setq b (rtos a 2 3))
       (setq el (subst (cons 1 b) (assoc 1 el1) el1))
       (entmod el)
(setq x (+ x 1))
); repeat

(setq el nil
     ss nil)
(setq en nil)
(setq a nil)
(setq v1 nil)


(setvar "dimzin" olddimzin)
(setvar "cmdecho" 1)
(princ)

); END a2lm DEFUN

the getval

;; Input  Dialog box with variable title
;; By Ah June 2012
;; code (ah:getval title)

(defun AH:getval (title width limit / fo)
(setq fname "C://acadtemp//getval.dcl")
(setq fo (open fname "w"))
(write-line "ddgetval : dialog {" fo)
(write-line " : row {" fo)
(write-line ": edit_box {" fo)
(write-line (strcat "    key = "  (chr 34) "key1" (chr 34) ";") fo)
(write-line  (strcat " label = "  (chr 34) title (chr 34) ";"  )   fo)
; these can be replaced with shorter value etc
;(write-line "     edit_width = 18;" fo) 
;(write-line "     edit_limit = 15;" fo)
(write-line width fo) 
(write-line limit fo)
(write-line "   is_enabled = true;" fo)        
(write-line "    }" fo)
(write-line "  }" fo)
(write-line "ok_only;}" fo)
(close fo)

(setq dcl_id (load_dialog  "c:\\getval"))
(if (not (new_dialog "ddgetval" dcl_id))
(exit))
(action_tile "key1" "(setq item $value)(done_dialog)")
(mode_tile "key1" 2)
(start_dialog)
; returns the value of item
)

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