Balji Posted March 5, 2013 Posted March 5, 2013 All I have to need one LISP program for match text properties. I like to change all text size and style with romans.txt size 3/32” and width factor .85. with in one click. Please help. Quote
pBe Posted March 5, 2013 Posted March 5, 2013 All I have to need one LISP program for match text properties.I like to change all text size and style with romans.txt size 3/32” and width factor .85. with in one click. Please help. How can that be "match text properties" Balji? Now if you meant change ALL TEXT TO 3/32" height and 0.85 width (defun c:BaljiEverybody (/ ss i e) (if (setq ss (ssget "_x" '((0 . "TEXT,MTEXT")))) (repeat (setq i (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (mapcar '(lambda (k j) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-put (list e k j)))) '("Height" "ScaleFactor") '(0.094 0.85)) ))) What is the text height in Millimeters ? Welcome back Tharwat EDIT: to change the text style as well .... (mapcar '(lambda (k j) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-put (list e k j)))) '("Height" "ScaleFactor" [b]"StyleName"[/b]) '(0.094 0.85 [b]"Romans"[/b])) ... I think the reason why you want to force the values is there are TEXT properties that are "fudge" Quote
Tharwat Posted March 5, 2013 Posted March 5, 2013 (edited) Welcome back Tharwat Thank you so much pBe for the welcome my friend . Try this draft at the moment . Removed Edited March 6, 2013 by Tharwat Quote
Tharwat Posted March 5, 2013 Posted March 5, 2013 pBe , what's the need of the function Vl-catch-all-error-p in your routine since that it is not supported with if function for true or false checks ? Quote
Balji Posted March 5, 2013 Author Posted March 5, 2013 How can that be "match text properties" Balji? Now if you meant change ALL TEXT TO 3/32" height and 0.85 width (defun c:BaljiEverybody (/ ss i e) (if (setq ss (ssget "_x" '((0 . "TEXT,MTEXT")))) (repeat (setq i (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (mapcar '(lambda (k j) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-put (list e k j)))) '("Height" "ScaleFactor") '(0.094 0.85)) ))) [/i] Master:shock: Thank god you understand my problem. Otherwise I have to call you for this help. :oops:I recive one table which full with multi text. E.g. one value with multi style text(romans)123(romand)456. It is very hard to edit one by one. First I thought to call you for this problem but later I choose this Forum. It is nice to see again my name in Lisp. Thank you very much for help. As always you do. Quote
pBe Posted March 5, 2013 Posted March 5, 2013 pBe , what's the need of the function Vl-catch-all-error-p in your routine since that it is not supported with if function for true or false checks ? Reason: Locked layers The layers are locked for a reason, I leave the "unlocking" to the user. Quote
pBe Posted March 5, 2013 Posted March 5, 2013 Master:shock: Thank god you understand my problem. Otherwise I have to call you for this help. :oops:I recive one table which full with multi text. E.g. one value with multi style text(romans)123(romand)456. It is very hard to edit one by one. First I thought to call you for this problem but later I choose this Forum. It is nice to see again my name in Lisp. Thank you very much for help. As always you do. Glad it works for you. There are other ways to fix "fudge" text properties. holler if you need more help or just send me message on my email. I'm just around the corner Stay out of trouble Balji Cheers Quote
Tharwat Posted March 5, 2013 Posted March 5, 2013 Reason: Locked layers As far as I know , the vl-catch-all-apply could pass any error that may take a place for instance Locked layers , and the vl-catch-all-error-p would return T if error took a place which is not needed in this case , just wondering . Quote
Balji Posted March 5, 2013 Author Posted March 5, 2013 Glad it works for you. There are other ways to fix "fudge" text properties. holler if you need more help or just send me message on my email. I'm just around the corner Stay out of trouble Balji Cheers Show me other ways too Please Quote
pBe Posted March 5, 2013 Posted March 5, 2013 As far as I know , the vl-catch-all-apply could pass any error that may take a place for instance Locked layers , and the vl-catch-all-error-p would return T if error took a place which is not needed in this case , just wondering . Oh i see what you mean. Good point Tharwat. I could have sworn there's another reason for that. anyhoo. cheers mate Quote
pBe Posted March 5, 2013 Posted March 5, 2013 Show me other ways too Please Why of course, I'll pass drop-by by your office sunday. see you then. Quote
Tharwat Posted March 5, 2013 Posted March 5, 2013 Oh i see what you mean. Good point Tharwat. Not a problem . Quote
Balji Posted March 5, 2013 Author Posted March 5, 2013 Why of course, I'll pass by your office sunday. see you then. Very Funny. I need it today or tomrrow. Still there are some texts with difrent style in same table. simple match properties comand not work on these. So problem still here, txt size change but style still same. see the attach. Quote
pBe Posted March 5, 2013 Posted March 5, 2013 If you have a look-see on my first post. i also included the option to change the textstyle. At any rate. HYG (defun c:BaljiEverybody (/ ss i e) (if (setq ss (ssget "_x" '((0 . "TEXT,MTEXT")))) (repeat (setq i (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (mapcar '(lambda (k j) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-put (list e k j)))) '("Height" "ScaleFactor" "StyleName") '(0.094 0.85 "Romans")) ) )(princ) ) Quote
Tharwat Posted March 6, 2013 Posted March 6, 2013 (edited) Did not you try my code mister OP ? Edited March 6, 2013 by Tharwat the word code was missing Quote
Balji Posted March 6, 2013 Author Posted March 6, 2013 If you have a look-see on my first post. i also included the option to change the textstyle. At any rate. HYG (defun c:BaljiEverybody (/ ss i e) (if (setq ss (ssget "_x" '((0 . "TEXT,MTEXT")))) (repeat (setq i (sslength ss)) (setq e (vlax-ename->vla-object (ssname ss (setq i (1- i))))) (mapcar '(lambda (k j) (vl-catch-all-error-p (vl-catch-all-apply 'vlax-put (list e k j)))) '("Height" "ScaleFactor" "StyleName") '(0.094 0.85 "Romans")) ) )(princ) ) Thank you very much. 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.