0 Members and 1 Guest are viewing this topic.
Have time to write one: Code: [Select](defun c:IncAtt ( / *IntGet1 AddTonth Mr parse gr g1 g2 nVal att)(vl-load-com) (defun *IntGet1 (fn msg) (initget 1) (setq val ((eval fn) msg)) (if (eq val "") (progn (princ "Null Input Try again") (*IntGet1 fn msg))) val )(defun AddTonth (str num val / stl orgstr attEnt) (setq str (strcat "©" str)) (if (and (setq stl (parse (reverse (vl-string->list str)))) (setq orgstr (nth (1- num) stl))) (substr (vl-string-subst (strcat (substr orgstr 1 1)(itoa ( + (atoi (substr orgstr 2)) val))) orgstr str) 2) ) )(defun parse (lst / a b c pr d) (while (setq a (car lst)) (setq b (cdr lst)) (if (and (>= a 48) (<= a 57)) (setq c (cons a c)) (if c (setq d (append (list (cons (car lst) c)) d ) c nil)) ) (setq lst b)) (mapcar 'vl-list->string d) )(setq MR nil) (while (null Mr) (princ (strcat "\nSelected Tag: " (if (or (null att) (/= (cdr (assoc 0 (entget att))) "ATTRIB")) "None" (cdr (assoc 2 (entget att)))) "\tInteger position: " (itoa (if (null pst) (setq pst 1) pst)) "\tIncrement Value: " (itoa (if (null val) (setq val 1) val)) "\nSelect texts or [Position/Value]<Enter when done:\n" ) ) (setq gr (grread nil 14 2) g1 (car gr) g2 (cadr gr) ) (cond ((and (= 2 g1) (member g2 '(118 86 ))) (setq val (*IntGet1 'Getint "\nEnter Increment Value: "))) ((and (= 2 g1) (member g2 '(112 80 ))) (setq pst (*IntGet1 'Getint "\nEnter Integer Position: "))) ((= 3 g1) (if (and (setq att (car (nentselp g2))) (eq (cdr (assoc 0 (entget att))) "ATTRIB")) (vla-put-TextString (vlax-ename->vla-object att) (if (setq nVal (AddTonth (cdr (assoc 1 (entget att))) pst val)) nVal (cdr (assoc 1 (entget att))))) (princ "\nNone Selected and/or No Integer Found\n")) ) ((and (= 2 g1) (member g2 '(32 13 )))(setq Mr T) ) ) )(princ))Hope this helps
(defun c:IncAtt ( / *IntGet1 AddTonth Mr parse gr g1 g2 nVal att)(vl-load-com) (defun *IntGet1 (fn msg) (initget 1) (setq val ((eval fn) msg)) (if (eq val "") (progn (princ "Null Input Try again") (*IntGet1 fn msg))) val )(defun AddTonth (str num val / stl orgstr attEnt) (setq str (strcat "©" str)) (if (and (setq stl (parse (reverse (vl-string->list str)))) (setq orgstr (nth (1- num) stl))) (substr (vl-string-subst (strcat (substr orgstr 1 1)(itoa ( + (atoi (substr orgstr 2)) val))) orgstr str) 2) ) )(defun parse (lst / a b c pr d) (while (setq a (car lst)) (setq b (cdr lst)) (if (and (>= a 48) (<= a 57)) (setq c (cons a c)) (if c (setq d (append (list (cons (car lst) c)) d ) c nil)) ) (setq lst b)) (mapcar 'vl-list->string d) )(setq MR nil) (while (null Mr) (princ (strcat "\nSelected Tag: " (if (or (null att) (/= (cdr (assoc 0 (entget att))) "ATTRIB")) "None" (cdr (assoc 2 (entget att)))) "\tInteger position: " (itoa (if (null pst) (setq pst 1) pst)) "\tIncrement Value: " (itoa (if (null val) (setq val 1) val)) "\nSelect texts or [Position/Value]<Enter when done:\n" ) ) (setq gr (grread nil 14 2) g1 (car gr) g2 (cadr gr) ) (cond ((and (= 2 g1) (member g2 '(118 86 ))) (setq val (*IntGet1 'Getint "\nEnter Increment Value: "))) ((and (= 2 g1) (member g2 '(112 80 ))) (setq pst (*IntGet1 'Getint "\nEnter Integer Position: "))) ((= 3 g1) (if (and (setq att (car (nentselp g2))) (eq (cdr (assoc 0 (entget att))) "ATTRIB")) (vla-put-TextString (vlax-ename->vla-object att) (if (setq nVal (AddTonth (cdr (assoc 1 (entget att))) pst val)) nVal (cdr (assoc 1 (entget att))))) (princ "\nNone Selected and/or No Integer Found\n")) ) ((and (= 2 g1) (member g2 '(32 13 )))(setq Mr T) ) ) )(princ))
I have a theory that software engineering is one of the few industries that are concerned with turning money into time - by spending money we (supposedly) save other people time by automating processes they'd otherwise have to do by some other means that would take them longer. (Concorde flight crews are another.)The trouble with the theory is that the processes we automate are far too often unnecessary anyway...
I hate to press spacebar everytime after I press "L" key
when I type "L"(line command ) ,CAD will type spacebar after "L"How to make "L" instead of "L+spacebar"?
Quote from: aaa120 on November 27, 2011, 12:44:11 AMwhen I type "L"(line command ) ,CAD will type spacebar after "L"How to make "L" instead of "L+spacebar"?You can use extra tools to do this.Like Autohook, or AutoHotkey.