TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Lee Mac on October 10, 2009, 10:09:58 AM

Title: Dynamic Text Alignment
Post by: Lee Mac on October 10, 2009, 10:09:58 AM
Had a bit of time free last night, was toying around with this idea - will let the user align text horizontally/vertically at any angle.

Not sure if its been done before or not...

(http://www.theswamp.org/screens/leemac/TxAlign.gif)

(http://www.theswamp.org/screens/leemac/TxAlignObj.gif)

Code: [Select]
;;;`,,`,,`,,`,,`,,`,,;;;
;;;,,`,,`,,`,,`,,`,,`;;;
;;                                                                               ;;
;;                      --=={  Dynamic Text Align  }==--                         ;;
;;                                                                               ;;
;;  Allows the user to dynamically align text to any angle. User is prompted to  ;;
;;  make a selection of Text or MText objects to align, and pick an alignment    ;;
;;  point, or select a text object to use for alignment. The selection of text   ;;
;;  is then aligned by either x or y coordinate, or dynamically stretched        ;;
;;  depending on the mode chosen.                                                ;;
;;                                                                               ;;
;;  The mode can be switched upon pressing TAB during alignment. Text and MText  ;;
;;  entities will be aligned in accordance with their respective justifications. ;;
;;                                                                               ;;
;;  The user can also specify a fixed text spacing, by pressing 'S' during text  ;;
;;  alignment. Holding Shift whilst aligning Text will alter Text Rotation, the  ;;
;;  user can also refine Rotation by pressing 'R' during text alignment. Text    ;;
;;  Justfication can be altered by pressing 'J' during text alignment.           ;;
;;                                                                               ;;
;;                                                                               ;;
;;  Object Alignment Mode:-                                                      ;;
;;  --------------------------                                                   ;;
;;  Text can be aligned to an object by pressing 'O' during text alignment. In   ;;
;;  this mode, the text spacing along the object can be adjusted by pressing     ;;
;;  'S' and the text offset from the object can also be altered by pressing 'O'. ;;
;;                                                                               ;;
;;  Text Rotation can be aligned to the tangent vector of the object at the      ;;
;;  point of alignment by holding Shift during text placement. The user can      ;;
;;  furthermore specify a text rotation by pressing 'R'.                         ;;
;;                                                                               ;;
;;  The order of the text entities along the object can be Reversed by pressing  ;;
;;  'V' during Text placement. The original order of these entities is           ;;
;;  determined by the drawing direction of the object.                           ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  FUNCTION SYNTAX:  TXALIGN                                                    ;;
;;                                                                               ;;
;;  Notes:-                                                                      ;;
;;  ---------                                                                    ;;
;;  Shift Functionality requires the user to have Express Tools installed.       ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  AUTHOR:                                                                      ;;
;;                                                                               ;;
;;  Copyright Lee McDonnell, October 2009. All Rights Reserved.                ;;
;;                                                                               ;;
;;      { Contact: Lee Mac @ TheSwamp.org, CADTutor.net }                        ;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;  VERSION:                                                                     ;;
;;                                                                               ;;
;;     1.0   ~~   12th October 2009   ~~   First Release                    ;;
;;...............................................................................;;
;;     1.1   ~~   14th October 2009   ~~   Added ability to Specify fixed   ;;
;;                                              text spacing                     ;;
;;...............................................................................;;
;;     1.2   ~~   15th October 2009   ~~   Added Stretch Mode               ;;
;;                                             Upgraded User messaging          ;;
;;...............................................................................;;
;;     1.3   ~~   18th October 2009   ~~   Added Rotation Functionality     ;;
;;...............................................................................;;
;;     1.4   ~~   20th October 2009   ~~   Added functionality to align     ;;
;;                                              text to object.                  ;;
;;...............................................................................;;
;;     1.5   ~~   23rd October 2009   ~~   Added Justification Options.     ;;
;;...............................................................................;;
;;     1.6   ~~   28th October 2009   ~~   Added Option to Select Text      ;;
;;                                              object at Alignment Point prompt ;;
;;...............................................................................;;
;;                                                                               ;;
;;=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=;;
;;                                                                               ;;
;;;`,,`,,`,,`,,`,,`,,;;;
;;;,,`,,`,,`,,`,,`,,`;;;

[ Code updated to Version 1.6 ]

Read the code header for help  :-)

Code available here (http://lee-mac.com/dynamictextalignment.html).
Title: Re: Dynamic Text Alignment
Post by: CAB on October 10, 2009, 11:05:58 AM
Looks like a dynamic bonanza around here. :roll:

Very cool.
Title: Re: Dynamic Text Alignment
Post by: SteveK on October 11, 2009, 05:13:31 PM
I think I'm gonna find that extremely useful! Thanks Lee (Though I thought you are meant to be studying now...)
Title: Re: Dynamic Text Alignment
Post by: SteveK on October 11, 2009, 05:15:29 PM
So yeah, looking forward to it. Though hopefully you can integrate a feature that allows for static vertical or horizontal (ie it'll just align one)
Title: Re: Dynamic Text Alignment
Post by: Hugo on October 12, 2009, 02:45:54 AM
Hallo Lee

Sieht Tool aus, aber wo kann man das Uploden
Title: Re: Dynamic Text Alignment
Post by: Bakerman on October 12, 2009, 07:00:05 AM

Hey, I think I could use something like that. Nice job!  :-)

Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 12, 2009, 08:00:56 AM
Thanks guys,

Haven't had too much time as you know, but will get the code on here asap  ;-)

Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 12, 2009, 08:01:50 AM
So yeah, looking forward to it. Though hopefully you can integrate a feature that allows for static vertical or horizontal (ie it'll just align one)

With regards to the static vertical/horizontal alignment, you can hit Ortho for these  :wink:
Title: Re: Dynamic Text Alignment
Post by: Krushert on October 12, 2009, 08:45:52 AM
Very cool beans.  I will give it a try. 

Maybe along the alignment feature throw in a "Enter amount of clear space between" user input variable/feature.  Pretty please with sugar on top.  :roll: :-)

Which is on my to-do list to add to antiquated text alignment proggy that I have. 
Title: Re: Dynamic Text Alignment
Post by: T.Willey on October 12, 2009, 11:27:10 AM
Very cool beans.  I will give it a try. 

Maybe along the alignment feature throw in a "Enter amount of clear space between" user input variable/feature.  Pretty please with sugar on top.  :roll: :-)

Which is on my to-do list to add to antiquated text alignment proggy that I have. 


Here is one I wrote awhile ago, not dynamic or anything though.......  :-)

Code: [Select]
(defun c:SpaceNotes (/ TxtRot TxtList TxtHt Obj NewInsPt InsPt Ent Dis1 StyObj DftHt TxtSty StyList curSty
    temp1 temp2 ss ocmd SpaceRatio)
;|
    Used to line up notes equally spaced vertically.
    By Tim Willey   Dec. 2004
    Sub's 'tmw:ss->Objlist 'tmw:Var->Safe 'MakeX 'value
    |;
   
    (setq ocmd (getvar "cmdecho")) (setvar "cmdecho" 0)
    (setq ActDoc (vla-get-ActiveDocument (vlax-get-ACAD-Object)))
    (vlax-invoke-method ActDoc 'StartUndoMark)
    (setvar "errno" 0)
    (while
        (and
            (not Ent)
            (/= (getvar "errno") 52)
        )
        (setq Ent (entsel "\n Select first note object: "))
        (if
            (and
                Ent
                (or
                    (= (value 0 (entget (car Ent))) "TEXT")
                    (= (value 0 (entget (car Ent))) "ATTDEF")
                )
                (not (redraw (car Ent) 3))
                (if (not (setq SpaceRatio (getdist "\n Enter ratio of typical distance between text objects [1.0]: ")))
                    (setq SpaceRatio 1.0)
                    T
                )
            )
            (progn
                (setq Obj (MakeX (car Ent)))
                (if (= (vla-get-Alignment Obj) 0)
                    (setq InsPt (safearray-value (variant-value (vla-get-InsertionPoint Obj))))
                    (setq InsPt (safearray-value (variant-value (vla-get-TextAlignmentPoint Obj))))
                )
                (setq TxtHt (vla-get-Height Obj))
                (setq TxtRot (vla-get-Rotation Obj))
                (setq TxtSty (vla-get-StyleName Obj))
                (setq CurSty (vla-get-ActiveTextStyle ActDoc))
                (setq StyList (vla-get-TextStyles ActDoc))
                (vlax-for item StyList
                    (if (= (vla-get-Name item) TxtSty)
                        (progn
                            (setq StyObj item)
                            (setq DftHt (vla-get-Height item))
                            (vla-put-Height item 0.0)
                        )
                    )
                )
                (vla-put-ActiveTextStyle ActDoc StyObj)
                (command "_.text" InsPt TxtHt TxtRot "N")
                (setq temp1 (entlast))
                (command "_.text" "" "N")
                (setq temp2 (entlast))
                (setq Dis1 (* SpaceRatio (distance (value 10 (entget temp1)) (value 10 (entget temp2)))))
                (vla-Delete (MakeX temp1))
                (vla-Delete (MakeX temp2))
                (if (setq ss (ssget '((0 . "TEXT,ATTDEF"))))
                    (progn
                        (setq TxtList (tmw:ss->Objlist ss))
                        (setq TxtList
                            (vl-sort
                                TxtList
                                '(lambda (a b)
                                    (>
                                        (cadr (tmw:Var->Safe (vla-get-InsertionPoint a)))
                                        (cadr (tmw:Var->Safe (vla-get-InsertionPoint b)))
                                    )
                                )
                            )
                        )
                        (foreach item TxtList
                            (setq InsPt (list (car InsPt) (- (cadr InsPt) Dis1) (caddr InsPt)))
                            (setq NewInsPt (vlax-3d-point InsPt))
                            (if (= (vla-get-Alignment item) 0)
                                (vla-put-InsertionPoint item NewInsPt)
                                (vla-put-TextAlignmentPoint item NewInsPt)
                            )
                        )
                    )
                )
            )
        )
    )
    (setvar "cmdecho" ocmd)
    (if Ent
        (progn
            (redraw (car Ent) 4)
            (vla-put-Height StyObj DftHt)
            (vla-put-ActiveTextStyle ActDoc CurSty)
        )
    )
    (vlax-invoke-method ActDoc 'EndUndoMark)
    (princ)
)
(defun MakeX (entname)
(vlax-ename->vla-object entname)
)
(defun tmw:ss->Objlist (ss / RtnList temp1)

(while (setq temp1 (ssname ss 0))
(setq RtnList (cons (vlax-ename->vla-object temp1) RtnList))
(ssdel temp1 ss)
)
RtnList
)
(defun tmw:Var->Safe (VariantValue /)

(if (= (type VariantValue) 'variant)
(safearray-value (variant-value VariantValue))
)
)
(defun VALUE (num ent /)
(cdr (assoc num ent))
)
Title: Re: Dynamic Text Alignment
Post by: Krushert on October 12, 2009, 01:59:18 PM
Very cool beans.  I will give it a try. 
Maybe along the alignment feature throw in a "Enter amount of clear space between" user input variable/feature.  Pretty please with sugar on top.  :roll: :-)

Which is on my to-do list to add to antiquated text alignment proggy that I have. 

Here is one I wrote awhile ago, not dynamic or anything though.......  :-)
And I will give that one a try too.
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 13, 2009, 07:21:09 AM
Still haven't got internet at home yet, but got some time to upload the code I have so far  ;-) - see the first post  :-)

Bug reports/Criticism/Comments are of course welcome.

Enjoy,

Lee
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 13, 2009, 02:17:40 PM
Nice one Lee...!!

your Idea concept is cool !   :ugly:
Keep Lispin !
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 13, 2009, 02:47:14 PM
maybe you can add something like...a rotation ?

Code: [Select]
[color=grey]
.......
  (setq bPt (vlax-get obj prop))
                       (if (setq iPt (inters pt data (polar bPt *tx 1) bPt nil))
                         (vlax-put Obj prop iPt))[/color]
[color=blue]
        (if (and (findfile "AcetUtil.arx") not acet-sys-shift-down)
          (arxload (findfile "AcetUtil.arx"))
        )
        (if (acet-sys-shift-down)
          (vla-put-rotation obj (+ (angle pt data) 1.5708))
        )
[/color]
[color=grey] ) t)
                  (  (= 2 code)                   
                     (cond  (  (= 13 data) nil)
                            (  (= 32 data) nil)[/color]
.....
Title: Re: Dynamic Text Alignment
Post by: Hugo on October 13, 2009, 03:12:03 PM
Hallo Lee

ein fester Winkel mit 90 oder 0 Grad wre auch toll.

Danke
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 13, 2009, 03:48:29 PM
Hallo Lee

ein fester Winkel mit 90 oder 0 Grad wre auch toll.

Danke

Das ist, was ich gerade hinzugefgt haben  :kewl:
Title: Re: Dynamic Text Alignment
Post by: Kerry on October 13, 2009, 04:14:05 PM
parenthesis seen missing ??

and a check like that should be done when the file loads, not in the middle of the routine :)

maybe you can add something like...a rotation ?

Code: [Select]
[color=grey]
.......
  (setq bPt (vlax-get obj prop))
                       (if (setq iPt (inters pt data (polar bPt *tx 1) bPt nil))
                         (vlax-put Obj prop iPt))[/color]
[color=blue]
        (if (and (findfile "AcetUtil.arx") not acet-sys-shift-down)
          (arxload (findfile "AcetUtil.arx"))
        )
        (if (acet-sys-shift-down)
          (vla-put-rotation obj (+ (angle pt data) 1.5708))
        )
[/color]
[color=grey] ) t)
                  (  (= 2 code)                   
                     (cond  (  (= 13 data) nil)
                            (  (= 32 data) nil)[/color]
.....

Title: Re: Dynamic Text Alignment
Post by: Andrea on October 13, 2009, 04:30:08 PM
parenthesis seen missing ??

and a check like that should be done when the file loads, not in the middle of the routine :)

maybe you can add something like...a rotation ?

Code: [Select]
[color=grey]
.......
  (setq bPt (vlax-get obj prop))
                       (if (setq iPt (inters pt data (polar bPt *tx 1) bPt nil))
                         (vlax-put Obj prop iPt))[/color]
[color=blue]
        (if (and (findfile "AcetUtil.arx") not acet-sys-shift-down)
          (arxload (findfile "AcetUtil.arx"))
        )
        (if (acet-sys-shift-down)
          (vla-put-rotation obj (+ (angle pt data) 1.5708))
        )
[/color]
[color=grey] ) t)
                  (  (= 2 code)                   
                     (cond  (  (= 13 data) nil)
                            (  (= 32 data) nil)[/color]
.....



no parenthesis is missing...
Title: Re: Dynamic Text Alignment
Post by: Kerry on October 13, 2009, 06:21:28 PM

Really ??

(findfile "AcetUtil.arx")  ;-> returns the file Path
not                        ;-> returns the SUBR object
acet-sys-shift-down        ;-> returns the SUBR object

I think you meant:-
(if (and (findfile "AcetUtil.arx") (not acet-sys-shift-down))

 ;; ... (arxload


If not, your logic is screwed.
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 14, 2009, 08:14:38 AM
Nice idea about the rotation - definitely going to include that in a later release  :wink:
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 14, 2009, 08:16:22 AM

Really ??

(findfile "AcetUtil.arx")  ;-> returns the file Path
not                        ;-> returns the SUBR object
acet-sys-shift-down        ;-> returns the SUBR object

I think you meant:-
(if (and (findfile "AcetUtil.arx") (not acet-sys-shift-down))

 ;; ... (arxload


If not, your logic is screwed.


well,..you'r right..

I didn't check that way..
thanks.

Ok Lee...it was just a suggestion....nice code.!
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 14, 2009, 08:16:35 AM
Andrea,

I find it better to check for ET, using something like this:

Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply (function (lambda ( ) (acet-sys-shift-down)))))
  (...


Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 14, 2009, 08:19:18 AM
I have updated the code in the first post to Version 1.1, now the user can specify the Text Spacing  8-)
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 14, 2009, 08:33:53 AM
Andrea,

I find it better to check for ET, using something like this:

Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply (function (lambda ( ) (acet-sys-shift-down)))))
  (...


OK...but i'm curious to know how many people have expresstool available but not loaded.. :?



Title: Re: Dynamic Text Alignment
Post by: GDF on October 14, 2009, 10:27:07 AM
The biggest problem with expresstools is the two versions for 32 and 64 bit. The arx files have the same name...so if you have them all on a network it gets to be a problem.
Title: Re: Dynamic Text Alignment
Post by: Krushert on October 14, 2009, 10:53:52 AM
I have updated the code in the first post to Version 1.1, now the user can specify the Text Spacing  8-)
Sweet!!!  8-)
I will play with it when I get to work and get a chance.  Home with a sick kid
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 14, 2009, 12:03:13 PM
The biggest problem with expresstools is the two versions for 32 and 64 bit. The arx files have the same name...so if you have them all on a network it gets to be a problem.

Sure if you mix all 64 and 32 bits files in same directory ..
maybe you need to revise the structure folder concept.
Otherwise...it is not seem to be a problem.
or maybe i'm not sure to understand the problem.. :|
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 14, 2009, 03:47:58 PM
another suggestion Lee...

is the spacing should be calculated from insertion point or space between text ?
I mean...if you select an MTEXT who have multiline with simple Dtext ..the spacing will take
the insertion of it and have as result a text over an MTEXT.

maybe by using textbox or boundingbox you can catch the textframe ?

Just a suggestion... :angel:
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 15, 2009, 06:43:32 AM
Andrea,

I find it better to check for ET, using something like this:

Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply (function (lambda ( ) (acet-sys-shift-down)))))
  (...


OK...but i'm curious to know how many people have expresstool available but not loaded.. :?

I suppose if the above does not return an error, then put a conditional to load the relevant Arx file  :-)
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 15, 2009, 06:46:40 AM
another suggestion Lee...

is the spacing should be calculated from insertion point or space between text ?
I mean...if you select an MTEXT who have multiline with simple Dtext ..the spacing will take
the insertion of it and have as result a text over an MTEXT.

maybe by using textbox or boundingbox you can catch the textframe ?

Just a suggestion... :angel:

Yeah, as you might have guessed, I am using the InsertionPoint/AlignmentPoint to space the text, perhaps a bounding box method would be better, but this would get complicated for text that is not aligned Vertically or Horizontally...   :angel:


I have updated the code in the first post to Version 1.1, now the user can specify the Text Spacing  8-)
Sweet!!!  8-)
I will play with it when I get to work and get a chance.  Home with a sick kid

Thanks Krushert, hope he/she gets better soon  :-)
Title: Re: Dynamic Text Alignment
Post by: alanjt on October 15, 2009, 09:19:54 AM
Andrea,

I find it better to check for ET, using something like this:

Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply (function (lambda ( ) (acet-sys-shift-down)))))
  (...


You could accomplish the same thing with
Code: [Select]
(and acet-sys-shift-down)
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 15, 2009, 10:02:56 AM
Andrea,

I find it better to check for ET, using something like this:

Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply (function (lambda ( ) (acet-sys-shift-down)))))
  (...


You could accomplish the same thing with
Code: [Select]
(and acet-sys-shift-down)

I thought that (acet-sys-shift-down) threw an error if the user did not have ET, is this not the case?   :?
Title: Re: Dynamic Text Alignment
Post by: alanjt on October 15, 2009, 10:19:06 AM
Andrea,

I find it better to check for ET, using something like this:

Code: [Select]
(if (vl-catch-all-error-p
      (vl-catch-all-apply (function (lambda ( ) (acet-sys-shift-down)))))
  (...


You could accomplish the same thing with
Code: [Select]
(and acet-sys-shift-down)

I thought that (acet-sys-shift-down) threw an error if the user did not have ET, is this not the case?   :?

(and Anything) or (not Anything) just checks to see if its something defined.

Code: [Select]
(and (not acet-sys-shift-down)
     (findfile "AcetUtil.arx")
     (arxload (findfile "AcetUtil.arx"))
     )
Title: Re: Dynamic Text Alignment
Post by: CAB on October 15, 2009, 10:24:29 AM
You left out (null Anything)  8-)
Title: Re: Dynamic Text Alignment
Post by: alanjt on October 15, 2009, 10:28:59 AM
You left out (null Anything)  8-)
I didn't think about null, the only time I've ever even used null is vl-remove-if[-not] 'null.
Thanks Alan. :)
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 15, 2009, 12:34:51 PM
another approach..

Code: [Select]
(if (eval c:expresstools) ..
or
Code: [Select]
(if c:expresstools ..
?
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 16, 2009, 07:24:54 AM
Ahh, I see - thanks Alan(s) - I had just never seen it used in that way  ;-)



Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 16, 2009, 07:32:24 AM
I have updated the code in the first post to include a new mode: STRETCH  ;-)
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 16, 2009, 08:34:48 AM
wow !  better and better... ;-)

one point..
the S option not working on Stretch mode... :pissed:
Title: Re: Dynamic Text Alignment
Post by: CAB on October 16, 2009, 08:46:47 AM
You left out (null Anything)  8-)
I didn't think about null, the only time I've ever even used null is vl-remove-if[-not] 'null.
Thanks Alan. :)
I use nil in that case:
Code: [Select]
(vl-remove nil '(1 2 3 nil 4))
Title: Re: Dynamic Text Alignment
Post by: alanjt on October 16, 2009, 09:03:22 AM
You left out (null Anything)  8-)
I didn't think about null, the only time I've ever even used null is vl-remove-if[-not] 'null.
Thanks Alan. :)
I use nil in that case:
Code: [Select]
(vl-remove nil '(1 2 3 nil 4))
Well.....I'm just dumb.
Thanks Alan. :-)
Title: Re: Dynamic Text Alignment
Post by: CAB on October 16, 2009, 09:27:12 AM
Just add another tool to your tool box. 8-)
Title: Re: Dynamic Text Alignment
Post by: alanjt on October 16, 2009, 09:31:08 AM
Just add another tool to your tool box. 8-)
Far too many of my tools have Thanks to CAB on them.
Thanks Alan. :)
Title: Re: Dynamic Text Alignment
Post by: cjw on October 16, 2009, 10:29:02 PM
Nice work Lee~
It will be more nice after make the "STRETCH" Dynamic too~~ 8-)
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 18, 2009, 07:51:24 AM
wow !  better and better... ;-)

one point..
the S option not working on Stretch mode... :pissed:

Thanks Andrea - I have plenty of other ideas to come!  :wink:

As for the spacing option (s) - in Stretch mode a message appears on the command line, saying that Text cannot be spaced in that mode... because obviously the spacing would be altered as soon as the user hit enter...  ;-)

Lee
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 18, 2009, 07:55:55 AM
Had some free time, so have updated the code to Version 1.3, now with Rotation Options!  ;-)
Title: Re: Dynamic Text Alignment
Post by: SteveK on October 18, 2009, 05:20:51 PM
Great program Lee, the options keep on coming!
Title: Re: Dynamic Text Alignment
Post by: Andrea on October 19, 2009, 12:58:09 PM
Nice Lee.. !

We have something similar here..  ;-)
Title: Re: Dynamic Text Alignment
Post by: Krushert on October 19, 2009, 04:19:59 PM
Nice LEE! 

My only minor comment/suggestion/tweak would be to allow it to use polar mode instead of ortho mode?
Very far from a deal breaker.

Thanks.
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 20, 2009, 07:14:39 AM
Nice Lee.. !

We have something similar here..  ;-)

Thanks Andrea... you always have something similar...  :wink:

Nice LEE! 

My only minor comment/suggestion/tweak would be to allow it to use polar mode instead of ortho mode?
Very far from a deal breaker.

Thanks.

I never really use the Polar mode too much, but I shall investigate and see what can be done  :wink:

Thanks for the comments guys  :-)
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 20, 2009, 07:22:09 AM
I have updated the first post with Version 1.4, to include the Object Alignment Utility  ;-)


Enjoy!  :-)
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 25, 2009, 09:00:58 AM
Just adding finishing touches to the routine... the user can now alter the Justification of the Text that is being aligned, by pressing 'J'.

Code in first post updated to Version 1.5
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on October 29, 2009, 08:21:20 AM
One final update - Version 1.6  will allow the user to select a Text Object to use as an alignment point...  8-)
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on April 05, 2014, 09:08:20 AM
Dynamic Text Alignment TXALIGN from 2009:

(http://lee-mac.com/swamp/textalign1.gif)

'New' TEXTALIGN command in AutoCAD 2015:

(http://lee-mac.com/swamp/textalign2.gif)

Not sure whether to be flattered or annoyed by the imitation...  :|
Title: Re: Dynamic Text Alignment
Post by: snownut2 on April 05, 2014, 09:56:19 AM
Looks like yours works better, maintains proper vertical spacing when selected..
Title: Re: Dynamic Text Alignment
Post by: MP on April 05, 2014, 12:38:29 PM
Be amused you did it first, did it better, and did it in LISP. Sh!tcan any other responses, they don't benefit you in any way. 
Title: Re: Dynamic Text Alignment
Post by: Lee Mac on April 05, 2014, 05:14:05 PM
Thanks guys.

@MP, there was the initial frustration that the idea behind my program had been taken and touted as a new command, but you are right - its pointless for me to dwell on it, and so I should simply take comfort in the knowledge that my peers can see through the imitation.

Cheers,

Lee
Title: Re: Dynamic Text Alignment
Post by: MP on April 05, 2014, 10:39:36 PM
I hear you Lee. Generally speaking, more bad than good tends to happen when one takes direct exception and makes a huge fuss over someone copying ideas, code or style. I've seen many people react in a spectrum of ways, and even though they're fully entitled to feelings of outrage for plagiarism et al a big portion of the animosity and general ill will tends to taint and stick to the victim. I am not saying it's fair. Hardly. The solution is not to let bastards skate free, no, but objective community members with no vested interest should call foul when they see it. Unfortunately it does not happen near the frequency it should. But that could improve, and quickly, because one action begets another. In your case the best approach would be to merely identify the blatant idea lift sans any attitude and then let others supply the criticism. Tongues will wag given the slightest in.

tl;dr: Peer support, how the good [expletive du jour] does it really work?

PS: Do I need to add "this is just my opinion"? Squirrel.
Title: Re: Dynamic Text Alignment
Post by: Marc'Antonio Alessi on April 07, 2014, 11:00:28 AM
One final update - Version 1.6  will allow the user to select a Text Object to use as an alignment point...  8)
Lee, I have tried in 2013 but:
Comando: TXALIGN

Error: funzione errata: ACET-SYS-SHIFT-DOWN

;;  Notes:-                                                                      ;;
;;  ---------                                                                    ;;
;;  Shift Functionality requires the user to have Express Tools installed.       ;;

I do not have ET... but I did not used Shift Functionality...
Thanks for all.