Author Topic: Place Text using grread  (Read 3992 times)

0 Members and 1 Guest are viewing this topic.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Place Text using grread
« on: September 27, 2009, 12:30:02 PM »
PlaceText.lsp is a beta version of a routine designed to allow the User some additional
options when placing or moving text. The code was inspired by Lee Mac and Andrea.
Some of the code came from Lee Mac's NumInc.lsp.

This is a sub function to be called by a LISP when Mtext or Plain Text is to be places
by the user. Typically you use getpoint but it has no visual feedback. In the past
I used a version of the MOVE command which was manageable but pragmatically
clumsy.  The new routine can be called with options to harness some of the features.

The main drawback at this time is the lack of osmode & the osmode markers but with text
the osnap is not used too often by me.

The Ortho Mode is not yet implemented but I plan to and a disable flag as well.

There is no Escape key trap yet as that interferes with debugging but I will add that
after the beta testing is done.

Code - Auto/Visual Lisp: [Select]
  1. ;;  ···········································································
  2. ;;  >-=((((°>`·.¸¸.·´¯`·.¸.·´¯`·... >-=((((°> `·.¸¸.·´¯`·.¸.·´¯`·... >-=((((°>
  3. ;;  
  4. ;;  PlaceText.lsp  Version 1.0 Beta
  5. ;;  Allow user to place text with enhanced features
  6. ;;  
  7. ;;  Copyright© 2009 Charles Alan Butler aka CAB from TheSwamp.org
  8. ;;
  9. ;;  USAGE ->  (PlaceText <vlaObject> '(Option Flags))
  10. ;;    Move point is based on the Alignment point of the text
  11. ;;
  12. ;;  Options Flags ->  List of pair list
  13. ;;    Option pairs may be in any order & may be omitted for default values
  14. ;;       (list '(<String> <Data>) '(<String> <Data>))
  15. ;;          <String> = string for option identification
  16. ;;     Identifier  DataType  Default  Action
  17. ;;      "erase"     Logic     true    erase text if user exits using ENTER
  18. ;;      "curve"     Logic     true    Allow Curve Align Option
  19. ;;     "textgap"    Real      0.1     step amount for text gap
  20. ;;   "rotationstep" Real   0.0174533  step amount for rotation
  21. ;;
  22. ;;    (PlaceText <vlaObject> '(("erase" nil))) = use default options
  23. ;;
  24. ;;  RETURN ->   an error message or nil if successful
  25. ;;
  26. ;;  -=<  User Options  >=-
  27. ;;  >>  Enter          =  Exit
  28. ;;  >>  Space          =  Rotate CCW
  29. ;;  >>  Shift + Space  =  Rotate CW
  30. ;;  >>  Tab            =  Rotate 90 deg
  31. ;;  >>  Shift + Tab    =  Mirror Rotation
  32. ;;  >>  C              =  Curve Aligned, place text next to curve object
  33. ;;    >>>  [A] = toggle auto angle correction
  34. ;;    >>>  [P] = Text Perpendicular to object, also [Tab]
  35. ;;    >>>  [+] = Adjust Offset from object
  36. ;;    >>>  [-] = Adjust Offset from object
  37. ;;
  38. ;;  Thanks to Lee Mac for ideas & code from his NumInc.lsp
  39. ;;
  40. ;;  Need to add Trap for ESCape key        <---------------<<<<
  41. ;;  May include a Layer Override feature in future
  42. ;;
  43. ;;  YOU MAY USE THIS CODE ONLY FOR *NON-COMMERCIAL*
  44. ;;  PURPOSES AND ONLY IF YOU RETAIN
  45. ;;  THIS HEADER COMPLETE AND UNALTERED
  46. ;;  you must contact me if you want to use it commercially
  47. ;;  
  48. ;;  >-=((((°>`·.¸¸.·´¯`·.¸.·´¯`·... >-=((((°> `·.¸¸.·´¯`·.¸.·´¯`·... >-=((((°>
  49. ;;  ···········································································
  50.  
  51. (defun PlaceText (tObj        ; expects a vla object, text or mtext
  52.                  Options      ; list of option flags, may be nil
  53.                  / CurMod     ; t/nil  On/Off flag for Align Mode
  54.                  RetMsg       ; hold message to return
  55.                  txtpoint     ; text point method needed to modify point
  56.                  OrgPoint     ; original text point
  57.                  OrgRot       ; original text rotation
  58.                  GapStep      ; step amount for text gap
  59.                  AngStep      ; step amount for rotation
  60.                  RemoveIfUserQuit ; erase the text object id the use quits
  61.                  doc cang cpt data ent grdat lang msg pt rot shiftOK TxtHgt
  62.                 )
  63.   ;;  CAB test to see if vlax-curve can be used on an object or ent
  64.   (defun curveOK (ent)        ; returns nil if not allowed
  65.            (vl-catch-all-apply 'vlax-curve-getendparam (list ent))
  66.          )
  67.     )
  68.   )
  69.   (defun CurMsg (flag)
  70.     (strcat "\n<< Type [+] or [-] for offset, and [P]erpendicular >>"
  71.              "\n<< [A] to toggle auto angle correction "
  72.               (if flag "OFF" "On") " >>" )
  73.   )
  74.  
  75.  
  76.   ;;  function is wrapped in a COND statement for error detection
  77.   (cond
  78.          :vlax-true
  79.      )
  80.      (princ "\n***  ERROR - Layer is Locked. Can not continue.")
  81.     )
  82.          :vlax-true
  83.      )
  84.      (princ "\n***  ERROR - Layer is Frozen. Can not continue.")
  85.     )
  86.    
  87.     ;;------------------------------------------------------------
  88.     (t                        ; OK to proceed  <---------------<<<
  89.  
  90.      ;;  set up point to get from text
  91.      ;;  needed to get the proper method for insertion point
  92.      (if (and (= (vla-get-objectname tObj) "AcDbText")
  93.               (not (zerop (vla-get-Alignment tobj)))
  94.          )
  95.        (setq txtpoint "TextAlignmentPoint")
  96.        (setq txtpoint "InsertionPoint")
  97.      )
  98.      ;;(setq point ((eval (read(strcat "vla-get-" txtpoint))) tobj)) ; example usage
  99.  
  100.  
  101.      ;;  ============  Set Defaults  =====================
  102.      (setq DefOptions ; (<Identifier> <VarName> <DefaultValue>)
  103.             '(("erase"    "RemoveIfUserQuit" t)    ; erase the text object if the use quits
  104.               ("curve"     "AllowCurveAlign" t)    ; Curve Method Flag
  105.               ("textstep"     "GapStep"      0.1)  ; step amount for text gap
  106.               ("textgap"      "*TextGap*"    1.0)  ; gap multiplier between text an aligned object (* TxtHgt *TextGap*)
  107.               ("alignangle"   "*AngInc*"     0.0)  ; angle to align to object 0= parallel
  108.               ("rotationstep" "AngStep"      (/ pi 180.0)) ; step amount for rotation
  109.               ))
  110.      
  111.      ;;  Decode Options
  112.          (setq Options (mapcar '(lambda(x)(list (strcase (car x) t) (cadr x))) Options))
  113.          (foreach opt DefOptions
  114.            (if (setq varData (assoc (car opt) Options))
  115.              (set (read (cadr Opt)) (eval (cadr VarData)))
  116.              (set (read (cadr Opt)) (eval (caddr Opt)))
  117.            )
  118.          )
  119.      ;;  ============  End of Set Defaults  =====================
  120.      
  121. ;; Refer notes regarding (acet-load-expresstools) in Post Reply #14
  122.      ;; Set Express Tools Flag
  123.      (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda()(acet-sys-shift-down))))
  124.        (alert "\n** ExpressTools not loaded. Some Functions May not be Available. **")
  125.        (setq shiftOK T)
  126.      )                        
  127.  
  128.      (setq OrgPoint ((eval (read (strcat "vla-get-" txtpoint))) tobj))
  129.      (setq OrgRot (vla-get-rotation tObj)
  130.            rot    OrgRot
  131.      )
  132.      (setq TxtHgt (vla-get-height tObj))
  133.  
  134.      (princ
  135.        (setq msg
  136.               (strcat
  137.                  "\n[ENTER]= Quit, "
  138.                  (if AllowCurveAlign "[C]urve Aligned, " "")
  139.                    "[Space] = Rotate CCW, [Tab] = Rotate 90"
  140.                    "\n[Shift] + [Space] = Rotate CW, [Shift] + [Tab] = Mirror Rotation"
  141.                  )
  142.        )
  143.      )
  144.  
  145.  
  146.      ;;  -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=-
  147.      ;;           M a i n   L o o p   f o r   u s e r   i n p u t                    
  148.      ;;  -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=-
  149.  
  150.      (while                   ; if last return value from progn is not nil, continue to loop
  151.        (progn
  152.          (setq grdat (grread t 15 0)
  153.                data  (cadr grdat)
  154.          )
  155.          (setvar "MODEMACRO"
  156.                  (strcat "Rotation: "
  157.                          (rtos (rem (fix (* 180. (/ rot pi))) 360) 2 2)
  158.                          (chr 186)
  159.                  )
  160.          )
  161.          (cond
  162.            ;;   --------------------------------------------------
  163.            ;;   -------   mouse movement updated here  -----------
  164.            ;;   --------------------------------------------------
  165.  
  166.            ;; Got Pointing device Drag Mode input and a point
  167.            ((and (= 5 (car grdat)) (listp data))
  168.             (cond             ; two conditions: Curve Aligned On or OFF
  169.               (CurMod         ; Curve Aligned is set ON
  170.                (setq cPt (cadr grdat))
  171.                (setq pt   (vlax-curve-getClosestPointto ent cPt)
  172.                      cAng (angle pt cPt)
  173.                      lAng (+ cAng *AngInc*)
  174.                )
  175.                (cond ((and *AngCor* (> lang (* 0.51 pi)) (< lang (* 1.51 pi)))
  176.                       (setq lang (+ lang pi)) ;flop text at >90 and <270
  177.                       (vla-put-Rotation tObj lAng) ; Update the angle
  178.                      )
  179.                )
  180.                ((eval (read (strcat "vla-put-" txtpoint))) ; update the point
  181.                  tobj
  182.                  (vlax-3D-point (trans (polar pt cAng (* TxtHgt *TextGap*)) 1 0))
  183.                )
  184.                (vla-put-Rotation tObj lAng) ; Update the angle
  185.               )
  186.               (t              ; Standard Mode, Curve Aligned is set Off
  187.                ((eval (read (strcat "vla-put-" txtpoint)))
  188.                  tobj
  189.                  (vlax-3D-point (trans data 1 0))
  190.                )
  191.                (and (>= rot (* 2 pi))(setq rot (- rot (* 2 pi))))
  192.                (vla-put-rotation tObj rot)
  193.               )
  194.             )
  195.             t                 ; stay in Loop
  196.            )                  ; end Pointing device Drag Mode input
  197.            ;;  -----------------------------------------------------------------
  198.  
  199.            ;;   ((member (car grdat) '(11 25))) ; [Right Click], must be handled seperatly
  200.  
  201.            
  202.            ;;  ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  203.            ;;      Key Press by user evaluated here
  204.            ;;  ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  205.            ((= 2 (car grdat))
  206.             ;;  React to the key press
  207.             (cond
  208.               ((eq data 13)   ; [Enter]   User wants to Quit without moving text
  209.                (cond
  210.                  ((and tObj RemoveIfUserQuit)
  211.                   (or (vlax-erased-p tObj) (vla-delete tObj))
  212.                  )
  213.                  (t           ; restore the original text object
  214.                   ((eval (read (strcat "vla-put-" txtpoint))) tobj OrgPoint)
  215.                   (vla-put-rotation tObj OrgRot)
  216.                  )
  217.                )
  218.                (princ (setq RetMsg "\n** User Quit **"))
  219.                nil            ; Exit Loop
  220.               )
  221.  
  222.  
  223.               ;;  Begin Curve Aligned Mode if allowed
  224.               ;;  Failure to select sutiable object will turn the mode off
  225.               ((and AllowCurveAlign (vl-position data '(99 67))) ; C/c Curve Aligned
  226.                (cond
  227.                  (CurMod (setq CurMod nil) (princ msg)) ; toggle OFF
  228.                  ((setq CurMod T) ; set mode ON
  229.                   (vla-put-visible tObj :vlax-false)
  230.                   (if (and (setq ent (car (entsel "\nSelect Curve to Align <Exit>: ")))
  231.                            (or (curveOK ent)
  232.                                (prompt "\n>>  Can not use that object to align.  <<")
  233.                            )
  234.                       )
  235.                     (princ (CurMsg *AngCor*))
  236.                     (progn
  237.                       (setq CurMod nil) ; set mode Off, failed to select object
  238.                       (princ msg)
  239.                     )         ; progn
  240.                   )           ; endif
  241.                   (vla-put-visible tObj :vlax-true)
  242.                  )
  243.                )
  244.                t              ; stay in Loop
  245.               )
  246.  
  247.  
  248.               ;;  process key press for Curve Aligned Mode Only
  249.               ((and CurMod (vl-position data '(43 61))) ; +  increase the text gap
  250.                (setq *TextGap* (+ GapStep *TextGap*))
  251.               )
  252.               ((and CurMod (vl-position data '(45 95))) ; -  decrease the text gap
  253.                (setq *TextGap* (- *TextGap* GapStep))
  254.               )
  255.               ((and CurMod (vl-position data '(9 80 112))) ; Tab Pp rotate relative angle 90 deg
  256.                (setq *AngInc* (- (/ pi 2) *AngInc*))
  257.               )
  258.               ((and CurMod (vl-position data '(65 97))) ; Aa  toggle Auto ang correction
  259.                (setq *AngCor* (not *AngCor*))
  260.                (princ (CurMsg *AngCor*))
  261.                t              ; stay in Loop
  262.               )
  263.               ;;  -----------------   end of Curve Mode  --------------------
  264.  
  265.               ((= 32 data)    ;[SHIFT] / [SPACE] rotate text object
  266.                (if (and shiftOK (acet-sys-shift-down))
  267.                  (setq rot (- rot AngStep))
  268.                  (setq rot (+ AngStep rot))
  269.                )
  270.                t              ; stay in Loop
  271.               )               ; (= 32 data)
  272.  
  273.               ((= 9 data)     ; [SHIFT] / [TAB]  rotate text object
  274.                (if (and shiftOK (acet-sys-shift-down))
  275.                  (setq rot (* -1.0 rot))
  276.                  ;;  if not cardinal point reset to 0.0
  277.                  (if (not (vl-position rot (list 0.0 (/ pi 2) pi (/ (* 3 pi) 2))))
  278.                    (setq rot 0.0)
  279.                    (setq rot (+ (/ pi 2) rot))
  280.                  )
  281.                )
  282.                t              ; stay in Loop
  283.               )               ; (= 9 data)
  284.  
  285.               ((= 15 data)  ; F8 = toggles orthomode  <OrthoMode Not Functioning Yet>
  286.                  (setvar "ORTHOMODE" (boole 6 1 (getvar "ORTHOMODE")))
  287.                t              ; stay in Loop
  288.               )
  289.              
  290.               ((princ "\n** Invalid KeyPress **") ;  Fall through condition
  291.                (princ msg)    ; stay in loop
  292.               )
  293.             )                 ; cond
  294.            )                  ; end (= 2 (car grdat)) Key Press by user
  295.            ;;  ¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤¤
  296.  
  297.  
  298.            ;;  ································································
  299.            ;;  Point picked by user, Normal Exit
  300.            ((and (= 3 (car grdat)) (listp data)) ; Text Placed
  301.             nil               ; Exit Loop
  302.            )
  303.            ;;  ································································
  304.            
  305.          )                    ; Main COND for user input - return will control the WHILE exit
  306.        )                      ; end progn - return will control the WHILE exit
  307.      )                        ; Main while LOOP
  308.      ;;  -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=- -=*=-
  309.      RetMsg
  310.     )
  311.   )                           ; end error trap COND
  312.   ;; return value will be error msg string or nil if tObj is moved successfully
  313. )



Code: [Select]
;;  ····························································
;;  TTTTT  EEEE   SSS   TTTTT       CCCC   OOO   DDDD    EEEE  ·
;;    T    E     S        T        C      O   O  D   D   E     ·
;;    T    EEE    SSS     T        C      O   O  D   D   EEE   ·
;;    T    E         S    T        C      O   O  D   D   E     ·
;;    T    EEEE   SSS     T         CCCC   OOO   DDDD    EEEE  ·
;;  ····························································

 
(defun c:test (/ ent tObj)
  ;;  place text  object using feature rich placement tool


  ;;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  ;;  DEBUG CODE - This is a routine to test call PlaceText.LSP
  (setq to_ucszdir (trans '(0 0 1) 1 0 T))
  (setq ent (entmakex
              (list '(0 . "TEXT") ;'(0 . "MTEXT")
                    '(100 . "AcDbEntity")
                    ;'(100 . "AcDbMText")
                    (cons 10 '(0 0 0))
                    (cons 40 1)
                    ;(cons 7 (getvar "TEXTSTYLE"))
                    (cons 1 "My Test String")
                    ;(cons 8 "Text")
                    (cons 50 (angle '(0 0) (trans (getvar "UCSXDIR") 0 to_ucszdir)))
              )
            )
  )
  ;(setq ent (car(entsel "\nSelect some text.")))
  ;;(vla-put-Alignment tObj acAlignmentMiddleCenter)
  ;;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  (PlaceText (vlax-ename->vla-object ent) '(("rotationstep" 0.01745)))
  (princ)
)



edit Kerry : refer line 127
« Last Edit: January 22, 2024, 10:15:22 PM by kdub_nz »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Place Text using grread
« Reply #1 on: September 27, 2009, 01:18:37 PM »
Nice job Alan - thanks for the mention, much appreciated.  :wink:

A few things I have noticed (only minor),

- I would include code to reset the MODEMACRO string on error/completion of routine.
- The shift/space does not work on 2010, but then it never did for my original code either  :-( - shift+tab works...so must be a bug with 2010.
- I always found that with regards to the Curve alignment, you get best results with a MC text alignment - but this is nothing to do with your code, just thought I'd add that  :-)

Nice code,

Lee

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Place Text using grread
« Reply #2 on: September 27, 2009, 01:27:07 PM »
This again utilises the coding in the NumInc.lsp, but also includes a feature to alter MText Width - if you're stuck for ideas  8-)

http://www.cadtutor.net/forum/showthread.php?t=37646

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Place Text using grread
« Reply #3 on: September 27, 2009, 01:31:30 PM »
Thanks Lee I'll take a closer look at MacAlign. 8-)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Place Text using grread
« Reply #4 on: September 27, 2009, 02:17:58 PM »
Thanks Lee I'll take a closer look at MacAlign. 8-)

I can never think of a good thing to name them...  :wink:

flowerrobot

  • Guest
Re: Place Text using grread
« Reply #5 on: September 27, 2009, 11:38:22 PM »
Quote
lack of osmode & the osmode markers

Purhaps some thing like this?
Only a tiny change to your program

Nice feature,

Ps. I havnt finished osmode yet, It need a little tweaking, But dont have the time atm

Flower


edit. looks like your options other than space bar dont work, As i said, tweaking :P
« Last Edit: September 27, 2009, 11:43:55 PM by flowerrobot »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Place Text using grread
« Reply #6 on: September 28, 2009, 07:42:41 AM »
Good beginning.
Have you looked at this code for grread osnaps by Evgeniy?
http://www.theswamp.org/index.php?topic=12813.msg157794#msg157794
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

flowerrobot

  • Guest
Re: Place Text using grread
« Reply #7 on: September 28, 2009, 05:54:28 PM »
Nope never seen it,

Will have a look at it when i have a chance, thanks

Hugo

  • Bull Frog
  • Posts: 431
Re: Place Text using grread
« Reply #8 on: January 04, 2012, 11:51:25 AM »
Hello

This tool is great, unfortunately we can only move and rotate text.
Would be great if you could make with blocks and other objects.
Thank you


Hallo

Diese Tool ist super leider kann man nur Texte verschieben und Drehen.
Wäre super wenn man das auch mit Blöcken und anderen Objekten machen könnte.
Danke

Lee Mac

  • Seagull
  • Posts: 12914
  • London, England
Re: Place Text using grread
« Reply #9 on: January 04, 2012, 03:14:26 PM »
Would be great if you could make with blocks and other objects.

Maybe this can help you Hugo?  :-)

Hugo

  • Bull Frog
  • Posts: 431
Re: Place Text using grread
« Reply #10 on: January 05, 2012, 03:17:11 AM »
@Lee

Yes Thank you
But I like the (Tab) button very well.

Ja Danke
Aber mir gefällt die (Tab) Taster sehr gut.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Place Text using grread
« Reply #11 on: January 05, 2012, 12:04:56 PM »
Boy, haven't worked on this routine in some time.
Lee's routine is a good one.

See attached my latest version. Try the MCR routine.
It was an ambitious lisp and I stopped working on it in January 2010.
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Dashmonkey

  • Newt
  • Posts: 29
  • (defun sleep nil nil)
Re: Place Text using grread
« Reply #12 on: January 05, 2012, 12:55:52 PM »
Awesome stuff, CAB!

I've always been meaning to try something like this, but this just takes the cake :)

The only issue I can see is that the MODEMACRO sysvar doesn't get reset when the function finishes/errors.

EDIT: Apparently Lee already beat me to the punch on point this out.
I didn't break it, I swear! ...ok, I broke it.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Place Text using grread
« Reply #13 on: January 05, 2012, 02:38:57 PM »
Alan

Like your PlaceText.lsp routine. I'm testing it out within my ANNO dialog box routine, for placing the text. I am using (PlaceTextit) to replace my (command "text" pt1 (getvar "textsize") "0" NTE) part of the ANNO code. So far everything is working smoothly. Thanks for sharing your routine.

I have modified the c:test to the following:
Code: [Select]
(defun PlaceTextit (/ ent tObj)
  (if (not PlaceText)(ARCH:LOAD (strcat ARCH#ANNF "PlaceText.lsp")))
  (setq to_ucszdir (trans '(0 0 1) 1 0 T))
  (setq ent (entmakex
              (list '(0 . "TEXT") ;'(0 . "MTEXT")
                    '(100 . "AcDbEntity")
                    (cons 10 '(0 0 0))
                    (cons 40 ARCH#SC-N)
                    (cons 41 (atof ARCH#TXNW))
                    (cons 7 ARCH#TXSN)
                    (cons 1 ARCH#NOTE)
                    (cons 8 (getvar "clayer"))
                    (cons 50 (angle '(0 0) (trans (getvar "UCSXDIR") 0 to_ucszdir)))
              )
            )
  ) 
  (PlaceText (vlax-ename->vla-object ent) '(("rotationstep" 0.01745)))
  (princ)
)
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

kdub_nz

  • Mesozoic keyThumper
  • SuperMod
  • Water Moccasin
  • Posts: 2140
  • class keyThumper<T>:ILazy<T>
Re: Place Text using grread
« Reply #14 on: January 22, 2024, 10:25:56 PM »
Testing of AutoCAD 2025 Beta has identified a new Lisp command for the forthcoming release.
Thanks to Chris Wade for the fix.

(acet-load-expresstools)
This command should be documented. It's intent is to reduce load-time by requiring a seperate command to load expresstools ( when required)

Alan's code will require a change around line 127 so the codeblock reads ;
Code - Auto/Visual Lisp: [Select]
  1.      ;;  ============  End of Set Defaults  =====================
  2.      
  3.  
  4.      ;; Set Express Tools Flag
  5.      (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda()(acet-sys-shift-down))))
  6.         (progn
  7.             (acet-load-expresstools)
  8.             (if (vl-catch-all-error-p (vl-catch-all-apply '(lambda()(acet-sys-shift-down))))
  9.               (alert "\n** ExpressTools not loaded. Some Functions May not be Available. **")
  10.               (setq shiftOK T)
  11.             )
  12.         )
  13.        (setq shiftOK T)
  14.      )
  15.  

This change will effect (I understand) anyone who is expecting ExpressTools to autoLoad as in previous versions.

Regards,
Called Kerry in my other life
Retired; but they dragged me back in !

I live at UTC + 13.00

---
some people complain about loading the dishwasher.
Sometimes the question is more important than the answer.