Author Topic: Looking for a Justify Text routine  (Read 2400 times)

0 Members and 1 Guest are viewing this topic.

AVCAD

  • Guest
Looking for a Justify Text routine
« on: August 27, 2010, 12:20:47 PM »
What i need is alittle more then just a Justify Text routine....

I need to find a string of text with a certain value and only that value...change the justification to left and change the widthfactor to 1...

I have like 400 drawings I need to do this too...and really dont want to do it manually...any help would be mucho appreciated...

Thanks!

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Looking for a Justify Text routine
« Reply #1 on: August 27, 2010, 02:36:38 PM »
QSELECT then PROPERTIES

mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Looking for a Justify Text routine
« Reply #2 on: August 27, 2010, 03:34:48 PM »
What i need is alittle more then just a Justify Text routine....

I need to find a string of text with a certain value and only that value...change the justification to left and change the widthfactor to 1...

I have like 400 drawings I need to do this too...and really dont want to do it manually...any help would be mucho appreciated...

Thanks!
;-)

why did you make that same mistake 400 times?

 ;-)
Be your Best


Michael Farrell
http://primeservicesglobal.com/

AVCAD

  • Guest
Re: Looking for a Justify Text routine
« Reply #3 on: August 27, 2010, 03:43:00 PM »
lol not my mistake...

its actually abunch of vendor drawings where they made every text set to fit so all the 1's look like stretched 7's and they need to be fixed...which is now my problem to fix...

AVCAD

  • Guest
Re: Looking for a Justify Text routine
« Reply #4 on: August 27, 2010, 03:45:08 PM »
Lee,

qselect then properties works but Filter works better...cause i can use filter by text then value 1 and then change the properties ....

What would be nice would be if I can do that in a script so i batch this and be done with it....

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Looking for a Justify Text routine
« Reply #5 on: August 27, 2010, 04:05:47 PM »
QSelect with 'Contents' can also be used  :wink:

A script could also be used to perhaps call a LISP to perform the operation.


mjfarrell

  • Seagull
  • Posts: 14444
  • Every Student their own Lesson
Re: Looking for a Justify Text routine
« Reply #6 on: August 27, 2010, 04:09:23 PM »
If one had MAP you could attach them all as a source, and fix them in one swift query/alter properties/saveback to source operation.
Be your Best


Michael Farrell
http://primeservicesglobal.com/

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Looking for a Justify Text routine
« Reply #7 on: August 27, 2010, 04:11:39 PM »
A quick LISP:

Code: [Select]
(defun c:FixText ( / ss )

  (if (setq ss (ssget "_X" '((0 . "TEXT") (1 . "YourStringHere"))))
    (
      (lambda ( x / e )
        (while (setq e (ssname ss (setq x (1+ x))))
          (Update
            (SubstDXF 72 0
              (SubstDXF 73 0
                (SubstDXF 41 1 (entget e))
              )
            )
          )
        )
      )
      -1
    )
  )

  (princ)
)

(defun SubstDXF ( code value elist )
  ;; © Lee Mac 2010
  (if elist
    (entmod
      (subst
        (cons code value) (assoc code elist) elist
      )
    )
  )
)

(defun Update ( elist )
  ;; © Lee Mac 2010
  (if elist (entupd (cdr (assoc -1 elist))))
)
       

Call in a script using:

Code: [Select]
(load "FixText.lsp" nil) (c:FixText)
« Last Edit: August 27, 2010, 07:36:15 PM by Lee Mac »

AVCAD

  • Guest
Re: Looking for a Justify Text routine
« Reply #8 on: August 27, 2010, 04:36:07 PM »
that works perfectly. I wish I was as smart as some of you.

Lee Mac

  • Seagull
  • Posts: 12915
  • London, England
Re: Looking for a Justify Text routine
« Reply #9 on: August 27, 2010, 07:35:50 PM »
that works perfectly. I wish I was as smart as some of you.

You're welcome, Its only practice really  ;-)