Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/18/2022 in all areas

  1. Divide c by 1000 when its a number. replace the last part of the lisp. (foreach r lst (setq col 0) (vla-SetRowHeight tab row (* 1.5 ht)) (foreach c r (vla-SetText tab row col (if (numberp c) (rtos (/ c 1000) 2 3) ;change 3 to show that many decimal places (vl-princ-to-string c) ) ) (setq col (1+ col)) ) (setq row (1+ row)) ) )
    1 point
  2. Hi, try this and let me know if it works for you ;;; By Isaac A 20221018 ;;; https://www.cadtutor.net/forum/topic/76182-text-modifiaction/ (vl-load-com) (defun c:remov (/ a b c d e f g h) (vl-cmdf "_undo" "_begin") (setq a (getvar 'cmdecho)) (setvar 'cmdecho 0) (prompt "\nSelect the texts to modify: ") (setq b (ssget '((0 . "*TEXT")))) (if (/= b nil) (progn (setq c 0 d (sslength b)) (while (< c d) (wcmatch (cdr (assoc 0 (setq e (entget (ssname b c))))) "TEXT,MTEXT") (setq f (cdr (setq g (assoc 1 e))) ) (if (/= nil (vl-string-search (chr 40) f)) (progn (setq h (substr f (+ (vl-string-search (chr 40) f) 2) (- (1- (vl-string-search (chr 41) f)) (vl-string-search (chr 40) f))) ) (setq e (subst (cons 1 h) g e)) (entmod e) ) ) (setq c (1+ c)) ) ) ) (setvar 'cmdecho a) (vl-cmdf "_undo" "_end") (princ) )
    1 point
  3. Thank you for your reply, i am afraid it is not, i don't have certain format of texts each time, the things that will always be there is the "X" and the brackets
    1 point
  4. Yes, when you initiate the LOFT command, watch your command line. You will have some options. One of the options is MOde, so type MO and hit Enter and then choose Solid. Then click your two polylines and it should create a 3D Solid.
    1 point
  5. If you're happy with this, Retable, by @exceed Then you can do this, then RETABLE it. (defun drawText (pt hgt str) (entmakex (list (cons 0 "TEXT") (cons 10 pt) (cons 40 hgt) (cons 1 str))) ) ;; command CMBL for Count Mtext By Layer (defun c:cmbl ( / ss i layer val subvalue sum_by_layer xy x y pt hgt rowhgt str) ;; user selects Mtext objects (setq ss (ssget (list (cons 0 "MTEXT")))) ;; associated list. (list (cons layer_name sum) ... ) (setq sum_by_layer (list)) (setq i 0) (repeat (sslength ss) ;; read the layer name and value. (setq layer (cdr (assoc 8 (entget (ssname ss i))))) (setq val (cdr (assoc 1 (entget (ssname ss i))))) ;; check if that value is a number. If there's anything else than a number we'll skip it (if (> (atof val) 0.0) (progn ;; check if that layer already has an associated sub sum (if (assoc layer sum_by_layer) (progn ;; (setq subsum (cdr (assoc layer sum_by_layer))) ;; read the already present value (setq subsum (+ subsum (atof val))) ;; add new value ;; now substitute the assoc value ... (subst new old list) (subst (cons layer subsum) (assoc layer sum_by_layer) sum_by_layer ) ) (progn ;; add that layer-value couple to the list (setq sum_by_layer (append sum_by_layer (list (cons layer (atof val))))) ) ) ) (progn ) ) (setq i (+ i 1)) ) (princ sum_by_layer) ;;;; Table (setq xy (getpoint "\nTable position: ")) (setq x (nth 0 xy)) (setq y (nth 1 xy)) (setq hgt 2.5) ;; text height (setq rowhgt 8) ;; row height ;; (drawText (list (+ x 24.0) y) hgt "COUNT") (setq y (- y rowhgt)) (drawText (list x y) hgt "ITEM") (drawText (list (+ x 24.0) y) hgt "LAYER") (drawText (list (+ x 60.0) y) hgt "QTY") (drawText (list (+ x 80.0) y) hgt "DESCRIPTION") (foreach row sum_by_layer (setq y (- y rowhgt)) (drawText (list x y) hgt "PIPE") (drawText (list (+ x 24.0) y) hgt (car row)) (drawText (list (+ x 60.0) y) hgt (rtos (cdr row) 2 2)) (drawText (list (+ x 80.0) y) hgt ".") ) (princ) )
    1 point
×
×
  • Create New...