Nikon Posted February 9 Author Posted February 9 (edited) 7 hours ago, Isaac26a said: But you can Modify it with numbers @Isaac26a Thanks, it works great! Now I can add my numbers... ??? Is it possible in this lisp to switch the keyboard layout from English to another language and then bring it back??? Edited February 9 by Nikon Quote
Nikon Posted February 12 Author Posted February 12 (edited) I add square brackets [ ] to highlight the letters. ;;; Enclose Texts with Round(), Square[], Curly{}, sTraight||, Forward//, Backward\\ ;;; Isaac A 20240208 09.02.2024 (vl-load-com) (defun c:entN2 (/ a b c d dw e f g o oe) (setq oe (getvar 'cmdecho) o (getvar 'osmode) ) (setvar 'cmdecho 0) (vla-startundomark (setq dw (vla-get-activedocument (vlax-get-acad-object)))) (setvar 'osmode 0) (princ "\nSelect the texts.") (if (setq a (ssget (list (cons 0 "TEXT,MTEXT")))) (progn (initget "Round Square Curly sTraight Forward Backward frQuotes") (setq b 0 c (sslength a) d (getkword "Round(), [Square[]/Curly{}/sTraight||/Forward///Backward\\\\/frQuotes«»] <R>: ") ) (while (< b c) (setq e (entget (ssname a b)) f (cdr (setq g (assoc 1 e))) ) (cond ((= d "Round") (setq f (strcat "("f")"))) ((= d "Square") (setq f (strcat "["f"]"))) ((= d "Curly") (if (= (cdr (assoc 0 e)) "TEXT") (setq f (strcat "{"f"}")) (setq f (strcat "\\{"f"\\}")) ) ) ((= d "sTraight") (setq f (strcat "|"f"|"))) ((= d "Forward") (setq f (strcat "/"f"/"))) ((= d "Backward") (setq f (strcat "\\"f"\\"))) ((= d "frQuotes") (setq f (strcat "«"f"»"))) (T (setq f (strcat "("f")"))) ) (setq e (subst (cons 1 f) g e)) (entmod e) (setq b (1+ b)) ) ) (princ "\nNo texts selected") ) (setvar 'cmdecho oe) (setvar 'osmode o) (vla-endundomark dw) (princ) ) d (getkword "Round(), [Square[]/Curly{}/sTraight||/Forward///Backward\\/ frQuotes«»] <R>: ") Edited February 12 by Nikon Quote
Recommended Posts
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.