No... I meant my performance (fat-finger typing). Thanks for the help. It worked perfectly until I added a few more parameters.
Now I get an error when I try to load it.
(defun c:ghj(/ enx idx sel str f n _Str) (if (setq sel (ssget "_X" '((0 . "TEXT,MTEXT") (1 . "*VERTICAL BEND")))) (repeat (setq idx (sslength sel)) (setq enx(entget (ssname sel (setq idx (1- idx)))) str(assoc 1 enx) _str (Cdr str)) (setq f nil n 16) (while (and (not f) (> n -1)) (setq f (vl-some '(lambda (k) (if (wcmatch _str (strcat k "*VERTICAL BEND")) (atoi k))) (list (itoa n) (if (zerop n) "-0" (itoa (- n)))))) (setq n (1- n)) ) (if (setq nstr (cond ((or ( Denverado.
I have to say, you only replied when you hit a snag otherwise we would've never known how helpful we are here.
Anyhoo. initial observation is too many closing parenthesis on the cond line.
(setq nstr (cond((or (
One more issue , the space between the equal operator and the number 39
guess you are right tharwat.. still not sure if it will work. Am too lazy to debug and try the code.
Cheers Tharwat Thanks everyone for your help.
I was on holidays.... that's why I never responded until I did.
You have all been very helpful.
Wow, that explains it, Good for you.Now did you made it work with the changes on the code? Sorry pBe..... Stuck on site for the last week.
I couldn't get it to work.
the "22.5 vertical bend" and "45vvertical bend" did not work.
(defun c:ghj(/ enx idx sel str f n _Str) (if (setq sel (ssget "_X" '((0 . "TEXT,MTEXT") (1 . "*VERTICAL BEND")))) (repeat (setq idx (sslength sel)) (setq enx(entget (ssname sel (setq idx (1- idx)))) str(assoc 1 enx) _str (Cdr str)) (setq f nil n 16) (while (and (not f) (> n -1)) (setq f (vl-some '(lambda (k) (if (wcmatch _str (strcat k "*VERTICAL BEND")) (atoi k))) (list (itoa n) (if (zerop n) "-0" (itoa (- n)))))) (setq n (1- n)) ) (if (setq nstr (cond((or ( Again here:
(setq f nil n 51)
I noticed you skipped 29 to 38? why is that? and if it should be included what is the new string then?
EDIT:
(defun c:ghj(/ enx idx sel str f n _Str)(if (setq sel (ssget "_X"'((0 . "TEXT,MTEXT") (1 . "*VERTICAL BEND,*HORIZONTAL BEND")))) (repeat (setq idx (sslength sel)) (setq enx(entget (ssname sel (setq idx (1- idx)))) str(assoc 1 enx) _str (Cdr str)) (setq f niln 51) (if (wcmatch _str "*HORIZONTAL BEND") (entmod (append enx (list (cons 8 "Defpoints")))) (progn (while (and (not f) (> n -1)) (setq f (vl-some '(lambda (k) (if (wcmatch _str (strcat k "*VERTICAL BEND")) (atoi k))) (list (itoa n) (if (zerop n) "-0" (itoa (- n)))))) (setq n (1- n)) ) (if(and f (setq nstr (cond((or ( Thanks pBe,
I ended up doing the following to make it work right.
(defun c:ghj(/ enx idx sel str f n _Str) (if (setq sel (ssget "_X" '((0 . "TEXT,MTEXT") (1 . "*VERTICAL BEND")))) (repeat (setq idx (sslength sel)) (setq enx(entget (ssname sel (setq idx (1- idx)))) str(assoc 1 enx) _str (Cdr str)) (setq f nil n 92) (while (and (not f) (> n -1)) (setq f (vl-some '(lambda (k) (if (wcmatch _str (strcat k "*VERTICAL BEND")) (atoi k))) (list (itoa n) (if (zerop n) "-0" (itoa (- n)))))) (setq n (1- n)) ) (if (setq nstr (cond((or (
页:
1
[2]