Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/19/2020 in all areas

  1. You need to set up where the lisp's are located as a search path in Autocad. Then you can use just the name, else need say [combineshadi]^C^C(LOAD "c:\\mylisp\\combineshadi") with full path to file. TYPE OPTIONS Add where the lisps are and also do Trusted paths, use the Add then browse.
    1 point
  2. Try this for me input as per image. But left out for moment. ;; Text Increment - original by Lee Mac ;; Increments numerical data found in a selection of Text or MText ;; objects by a value specified by the user. ;; Modified by AlanH Sep 2020 ;;https://www.cadtutor.net/forum/topic/71199-numeric-text-editing/ (defun c:txtinc ( / e i l s x minval maxval txt ) (if (null *inc*) (setq *inc* 1.0) ) (if (setq i (getreal (strcat "\nSpecify Increment <" (rtos *inc* 2) ">: "))) (setq *inc* i) ) (if (equal 0.0 (rem *inc* 1) 1e-8) (setq *inc* (fix *inc*)) ) (setq minval (getreal "\nEnter minimum value") maxval (getreal "\nEnter maximum value") ) (if (setq s (ssget "_:L" '((0 . "TEXT,MTEXT") (1 . "*#*")))) (progn (repeat (setq i (sslength s)) (setq e (entget (ssname s (setq i (1- i)))) x (assoc 1 e) strlst (reverse (LM:splitstring (cdr x))) txtstr "") (repeat(setq k (length strlst)) (setq txt (nth (setq k (1- k)) strlst)) (if (or (= (type txt) 'INT)(= (type txt) 'REAL)) (if (and (> txt minval)(< txt maxval)) (setq txt (rtos (+ txt *inc*) 2 0) ) (setq txt (rtos txt 2 0) ) ) ) (setq txtstr (strcat txtstr txt)) ) (entmod (subst (cons 1 txtstr) (assoc 1 e) e)) ) ) ) (princ) ) ;; Split String - Lee Mac ;; Splits a string into a list of text and numbers (defun LM:splitstring ( s ) ( (lambda ( l ) (read (strcat "(" (vl-list->string (apply 'append (mapcar (function (lambda ( a b c ) (cond ( (= 92 b) (list 32 34 92 b 34 32) ) ( (or (< 47 b 58) (and (= 45 b) (< 47 c 58) (not (< 47 a 58))) (and (= 46 b) (< 47 a 58) (< 47 c 58)) ) (list b) ) ( (list 32 34 b 34 32)) ) ) ) (cons nil l) l (append (cdr l) (list nil)) ) ) ) ")" ) ) ) (vl-string->list s) ) )
    1 point
×
×
  • Create New...