Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/11/2022 in all areas

  1. use vl-string-translate convert unwanted charters to space (or some other charter you will not use) and then remove those charters from the string. ;;----------------------------------------------------------------------------;; ;; Removes leading, traling, and double spaces (defun RemoveGaps (str) (while (/= str (setq str (vl-string-subst " " " " str)))) (vl-string-trim " " str) )
    1 point
  2. This should be what you need. www.lee-mac.com/steal.html
    1 point
  3. Thank you very much. It is perfect.
    1 point
  4. You can get the numbers from a string. eg "area = 1224" ;; Parse Numbers - Lee Mac ;; Parses a list of numerical values from a supplied string. ;; Author: Lee Mac, Copyright © 2013 - www.lee-mac.com ;; ;;------------------------------------------------------------;; (defun LM:parsenumbers ( str ) ( (lambda ( l ) (read (strcat "(" (vl-list->string (mapcar '(lambda ( a b c ) (if (or (< 47 b 58) (and (= 45 b) (< 47 c 58) (not (< 47 a 58))) (and (= 46 b) (< 47 a 58) (< 47 c 58)) ) b 32 ) ) (cons nil l) l (append (cdr l) '(())) ) ) ")" ) ) ) (vl-string->list str) ) )
    1 point
  5. Try the following [ untested ] codes and let me know. (defun c:Test (/ int sel ent get obj att pos ins) ;;------------------------------------------------------------;; ;; Author: Tharwat Al Choufi - Date: 10.Apr.2022 ;; ;; website: https://autolispprograms.wordpress.com ;; ;;------------------------------------------------------------;; (and (princ "\nSelect attributed blocks < M1502_P > : ") (setq int -1 sel (ssget '((0 . "INSERT") (66 . 1) (2 . "M1502_P"))) ) (while (setq int (1+ int) ent (ssname sel int) ) (and (setq get (entget ent) obj (vlax-ename->vla-object ent) pos (assoc 10 get) ins (mapcar '+ (cdr pos) '(0. 0.)) ) (vl-some (function (lambda (u) (and (= (vla-get-tagstring u) "HEIGHT") (setq att (vla-get-textstring u)) ) ) ) (vlax-invoke obj 'GetAttributes) ) (entmod (subst (cons 10 (append ins (list (distof att)))) pos get) ) ) ) ) (princ) ) (vl-load-com)
    1 point
×
×
  • Create New...