Does anyone know if there is a way to format the date fields to display as an ordinal date? (ie. 21st of January, 2014)
If you want to go the lisp way, I CAN help you with that. If not, this is all that I know for fields (as far as date stamps are concerned)... Let me know
None of the standard field date variables that suites you?
use the "Field" command and see the different formats for yourself.
That's when I turned 44.
Unfortunately there is no OOTB answer
You would have to write a lisp routine which would
1. Get the date
2. Check the last digit
3. Add the following text depending on the digit
1 = st
2 = nd
3 = rd
4 to 0 = th
Howard Walker
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
(defun c:test ( / *error* date mtext pt ) (vl-load-com) (defun *error* ( m ) (or (wcmatch (strcase m) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " m " **"))) (princ) ) (defun date ( / fixday d ) (defun fixday ( str / n ) (strcat (itoa (atoi str)) (cond ( (and (< 3 (setq n (atoi str)))(> 21 n)) "th" ) ( (eq "1" (setq n (substr str (strlen str)))) "st" ) ( (eq "2" n) "nd") ( (eq "3" n) "rd") ( "th") ) ) ) (strcat (fixday (substr (setq d (menucmd "M=$(edtime, $(getvar,date),MoDDYYYY)")) 3 2 ) ) " of " (nth (1- (atoi (substr d 1 2)) ) '("January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December") ) ", " (substr d 5) ) ) (defun mtext ( content height layer just insertionpoint flag / e ) (setq e (entmakex (list (cons 0 "MTEXT") (cons 100 "AcDbEntity") (cons 67 0) (cons 8 layer) (cons 100 "AcDbMText") (cons 10 insertionpoint) (cons 40 height) (cons 71 just) (cons 72 5) (cons 1 content) (cons 7 (getvar 'textstyle)) (cons 11 (list 1.0 0.0 0.0)) (cons 90 3) (cons 63 256) (cons 45 1.1) (cons 441 0) ) ) ) (if (and e flag) (vlax-ename->vla-object e) e ) ) (if (setq pt (getpoint "\nSpecify insertion point of Date: ")) (progn (mtext (date) (getvar 'textsize)(getvar 'clayer) actopleft pt nil) ) ) (princ) )
I couldn't resist!
Hi!
Is there any development in that would add the st, nd, th automatically? I still don't see a date type that offers that in the field creator tab, but I'm also not competent enough to do that lisp thing. 🙂
Can't find what you're looking for? Ask the community or share your knowledge.