Jump to content

Recommended Posts

Posted (edited)

Oops! - Header should read " Help Modifying Text Width Lisp "

 

 

I don't know where this code originated

(It's pretty old...)

but can someone *PLEASE* help me modify it

to also work with MTEXT and DIMENSIONS?

 

-Edit 7.29.2010

**After some research, screw MTEXT!! - not worth the hassle! **

I just need it to work with the various dimensions.

Associative, Multileader, etc.

 

 
(DEFUN C:TW (/ P OPTION NSTYLE NWIDTH L N E)
(PROMPT "\nChanges text width: ")
(setvar "cmdecho" 0)
(graphscr)
(command "undo" "m")
(Prompt "\nSelect text to be changed: ")
(setq olderr *error*
            *error* cterr)
(setq p (ssget))
(SETQ OPTION "Width")
(cond
       ((eq option "Width")
            (setq nwidth (getreal "\nEnter new width for text: "))))
(if p
    (progn
    (setq l 0 n (sslength p))
    (while (< l n)
(if (= "TEXT"
(cdr (assoc 0 (setq e (entget (ssname p l))))))
(progn
     (cond
((eq option "Width")
(setq e (subst (cons 41 nwidth) (assoc 41 e) e))))
(entmod e)))
(setq l (1+ l)))))
(princ))

 

While I would like to know HOW to modify this code,

if there is another routine better suited to change

the text width of any "text-related" entities I am

open to such as well...

 

Thanks!!

Edited by ILoveMadoka
edit
  • Replies 29
  • Created
  • Last Reply

Top Posters In This Topic

  • alanjt

    12

  • ILoveMadoka

    10

  • Tharwat

    7

  • lpseifert

    1

Top Posters In This Topic

Posted

Hi

The following is the same as yours ;

(DEFUN C:TW (/ p nwidth l n e)
(PROMPT "\nChanges text width: ")
(setq p (ssget '((0 . "TEXT"))))
       (setq nwidth (getint "\nEnter new width for text: "))
 (if (/= p nil)
    (progn
    (setq l 0
   n (sslength p))
    (while (< l n)
 (setq e (entget (ssname p l)))
(entmod (setq e(subst (cons 41 nwidth) (assoc 41 e) e))
)
      (setq l (1+ l))))
)
 (princ)
)

 

So the (assoc 41) in Mtext is not the same as Text please check DXF for more information.

 

Tharwat

Posted

Thank you, but that's not what I'm asking.

 

 

If I could write the code myself I wouldn't be asking here...

 

I'm trying to avoid asking the gods here directly for their assistance..

 

thanks though..

Posted

I'm trying to avoid asking the gods here directly for their assistance..

 

 

:lol::lol:

Posted
Thank you, but that's not what I'm asking.

 

If I could write the code myself I wouldn't be asking here...

 

I'm trying to avoid asking the gods here directly for their assistance..

 

thanks though..

 

I don't know why you are angry, actually you should be more patient to be able to get more information.

 

And I am sure that there are no gods in here, only human being are existed here.

 

And if you don't ask for help, that means you do not also help any one that's for sure.

 

So you don't have to thank any one if you don't want to. sweet heart.

 

I thanking you, and would never hesitate to help you if I could. be sure.

 

My best regards

 

Tharwat

Posted
And I am sure that there are no gods in here, only human being are existed here.

 

Do you have incontrovertible proof with which to backup your statement? :lol:

Posted

I have no comments regarding to your question or even your statement ........

 

I am so happy to be a normal human being .......8)

Posted
I have no comments regarding to your question or even your statement .......
Oh well, I guess not everyone loves skepticism as much as I do.

 

I am so happy to be a normal human being .......8)
Normal is a relative term. :wink:
Posted
.

 

Normal is a relative term.

Ya beat me to it.

Posted (edited)

I'm not angry at all.

Sorry if it came across that way.

 

I'm actually surprised I could find this code addressed

when I did a search.

 

I just know many times people have code in their arsenal

and that is what I was hoping for. While your answer was

helpful in it's own right I had to say that it wasn't what I was looking for

or others would think it was all I needed and not respond.

 

My problem now is that there is this long thread

and I still need help in my quest!

 

 

And I recognize the Lisp Dieties here and give them due honor...

Edited by ILoveMadoka
edit
Posted
"NORMAL" specially the modest . .. . . :D :D :shock:

 

That's me.

How modest of you.
Posted
I'm not angry at all.

Sorry if it came across that way.

 

I'm actually surprised I could find this code addressed

when I did a search.

 

I just know many times people have code in their arsenal

and that is what I was hoping for. While your answer was

helpful in it's own right I had to saythat it wasn't what I was looking for

or others would think it was all I needed and not respond.

 

My problem now is that there is this long thread

and I still need helping me in my quest!

 

 

And I recognize the Lisp Dieties here and give them due honor...

Anything worth having is worth working for.

 

A while back, I wrote one that will set the width of MText and MultiLeaders; is that what you want?

Posted
How modest of you.

 

As much as you can imagine ..8)

 

You must be living your life as a matter of Lisp in sequence :lol: 1+1=2

Posted (edited)
A while back, I wrote one that will set the width of MText and MultiLeaders; is that what you want?

 

 

Unsure.

Are multileaders handled the same as regular associative dimensions?

 

I have a set of 19 drawings that are a hodgepodge of every

possible type of dimension and text. Associative dimensions,

exploded dimensions, leaders, multileaders, text, mtext. All of them

at all sorts of widths (and heights). It's a friggin standardization nightmare.

 

My job? Make it right.

 

I wasn't trying to start anything.

I was actually hoping this would be an easy one...

Edited by ILoveMadoka
added text
Posted

Please!

Please!

Please!

Please!

 

PLEASE HELP!!!

Posted (edited)

I am researching this adnauseum and I can say with confidence

that this is far beyond the scope of my very limited lisp abilities.

It looks like it involves extended entity data.

 

Again, out of my league..

 

I am desperately begging here..

Edited by ILoveMadoka
rev
Posted
(defun c:WD (/ ss wd)
 ;; Change width of selected MText and MultiLeader objects
 ;; Alan J. Thompson, 11.05.09
 (if (and (setq ss (ssget "_:L" '((0 . "MTEXT,MULTILEADER"))))
          (setq wd (initget 4)
                wd (cond ((getdist "\nWidth <0.0>: "))
                         (0.)
                   )
          )
     )
   (progn
     (vlax-for x (setq ss (vla-get-activeselectionset
                            (cond (*AcadDoc*)
                                  ((setq *AcadDoc* (vla-get-activedocument
                                                     (vlax-get-acad-object)
                                                   )
                                   )
                                  )
                            )
                          )
                 )
       (vl-catch-all-apply
         (function vlax-put-property)
         (list x
               (cond ((eq (vla-get-objectname x) "AcDbMText") 'Width)
                     ((eq (vla-get-objectname x) "AcDbMLeader") 'TextWidth)
               )
               wd
         )
       )
     )
     (vla-delete ss)
   )
 )
 (princ)
)

Posted

Thank you very kindly Sir.

Posted
Thank you very kindly Sir.
Hope it helps.

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