.lsp file for editing attribute field to display todays date

.lsp file for editing attribute field to display todays date

mark.d.beardmore
Explorer Explorer
422 Views
4 Replies
Message 1 of 5

.lsp file for editing attribute field to display todays date

mark.d.beardmore
Explorer
Explorer

Morning all,

 

I'm trying to find a .lsp file that will let you click an attribute field, and replace the present value with todays date in the following format

DD/MM/YY

 

It might also be useful to have one which is in this format also

DD/MM/YYYY

I assume this is just a slight change to the lisp code?

 

Does anyone have these?

Thanks

Mark

0 Likes
Accepted solutions (1)
423 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

Guess it's just an attribute with plain text, not a (dynamic) field.

Post a sample block.

0 Likes
Message 3 of 5

mark.d.beardmore
Explorer
Explorer

Yes just a standard block & field

 

I've attached an example

0 Likes
Message 4 of 5

ВeekeeCZ
Consultant
Consultant
Accepted solution

Sure, as simple as that.

 


(defun c:Adate2 ( / d e) (if (setq d (itoa (fix (getvar 'cdate))) e (car (nentsel "Select attribute: "))) (setpropertyvalue (cdr (assoc 330 (entget e))) (cdr (assoc 2 (entget e))) (strcat (substr d 7 2) "/" (substr d 5 2) "/" (substr d 3 2)))) (princ) ) (defun c:Adate4 ( / d e) (if (setq d (itoa (fix (getvar 'cdate))) e (car (nentsel "Select attribute: "))) (setpropertyvalue (cdr (assoc 330 (entget e))) (cdr (assoc 2 (entget e))) (strcat (substr d 7 2) "/" (substr d 5 2) "/" (substr d 1 4)))) (princ) )

 

0 Likes
Message 5 of 5

mark.d.beardmore
Explorer
Explorer
That worked perfectly, thanks so much
0 Likes