Request: Apply Date Routine as MM/DD/YY
Could someone point to a LISP routine with a format similar or able to be modified per the subject line?
Thanks,
Clinton Hill
Comments
-
Your request is a bit vague. But perhaps this?:
(menucmd "M=$(edtime,$(getvar,date),MO/DD/YY)")
0 -
My pardons, Roy.
I appreciate your offering. I am little rusty and need to revisit basic customization: Might this code be assigned to a palette or toolbar button?
I was searching for an existing LISP program that would would allow the user to select an attribute value an existing value be replaced by the current date with a mouse click.
0 -
(defun c:DateToAtt ( / doc enm sel) (setq doc (vla-get-activedocument (vlax-get-acad-object))) (vla-endundomark doc) (vla-startundomark doc) (if (and (setq sel (nentsel)) (= 2 (length sel)) ; Avoid changing nested attributes. (setq enm (car sel)) (= "ATTRIB" (vle-entget 0 enm)) ) (vle-entmod 1 enm (menucmd "M=$(edtime,$(getvar,date),MO/DD/YY)")) ) (vla-endundomark doc) (princ) )
EDIT: Added a check to avoid changing nested attributes.
0 -
Have you considered using a FIELD? Depending on your requirements this would be a non-programming method to achieve the same.
Regards,
Jason Bourhill
CAD Concepts0 -
@Jason Bourhill said:
Have you considered using a FIELD? Depending on your requirements this would be a non-programming method to achieve the same.Regards,
Jason Bourhill
CAD ConceptsTake care using the FIELD option. The **FIELDEVAL **system variable may cause the date to auto-update, which may not be suitable if you wanted a static string.
Regards,
0 -
Sorry, I tried, but I can't help myself ... this is a pet peeve of mine
0 -
Excellent idea: Fields are very powerful. In this case, I prefer a static value. I appreciate your concern.
I was hoping someone might have a routine in their customization arsenal.0 -
I hope I can rise to the LISP programming challenge through creating this routine.
0 -
@chillme1 You have perhaps missed my 2nd contribution?
0 -
Indeed I did, sir !!! I thank you for this generous offering.
My aim is to refer to your code as a learning tool as well as applying it to daily drawing production.
Thanks, Roy.
Clint Hill
0