Jump to content

Recommended Posts

Posted

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.

Posted
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"

Posted (edited)

 

Welcome back Tharwat :)

 

Thank you so much pBe for the welcome my friend . :thumbsup:

 

Try this draft at the moment .

 

Removed 

Edited by Tharwat
Posted

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 ? :)

Posted
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. o:)

Posted
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.

Posted
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. o:)

 

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

Posted
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 .

Posted
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 :D

Posted
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. :thumbsup:

 

I could have sworn there's another reason for that. anyhoo.

 

cheers mate

Posted
Show me other ways too

 

Please :D

 

Why of course, I'll pass drop-by by your office sunday. see you then.

Posted
Oh i see what you mean. Good point Tharwat. :thumbsup:

 

Not a problem . :)

Posted
Why of course, I'll pass by your office sunday. see you then.

 

Very Funny. :glare:

I need it today or tomrrow. :danger:

 

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. :facepalm:

 

see the attach.$34AC3663024A3874.jpg

Posted

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)
 )

Posted (edited)

Did not you try my code mister OP ?

Edited by Tharwat
the word code was missing
Posted
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. :thumbsup:

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...