TheSwamp

CAD Forums => CAD General => Topic started by: jlogan02 on September 08, 2021, 05:11:39 PM

Title: text field with a day counter or "Return by Date"
Post by: jlogan02 on September 08, 2021, 05:11:39 PM
I have a stamp with a date in it. The user fills out the date the drawing should be returned, which is always +14 days from when they inserted the stamp & published the drawing. I'd like to create a field that reads todays date and add 14 days to it. Does anyone know if this is possible in a text field?

In excel it would be "=(TODAY()+14)". I just don't know of a diesel equivalent.

Title: Re: text field with a day counter or "Return by Date"
Post by: Lee Mac on September 08, 2021, 05:41:34 PM
Try the following DIESEL expression (change the formatting to suit):
Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),"dd mon yyyy")
Title: Re: text field with a day counter or "Return by Date"
Post by: jlogan02 on September 08, 2021, 06:05:12 PM
Try the following DIESEL expression (change the formatting to suit):
Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),"dd mon yyyy")

Code - Auto/Visual Lisp: [Select]
  1. $(+, $(edtime, $(getvar,date), 14)
I had tried this while waiting and got nowhere.

Will try your method.
Title: Re: text field with a day counter or "Return by Date"
Post by: jlogan02 on September 08, 2021, 06:12:45 PM
Not quite the result I was expecting. I edited to this...

Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),"MM-DD-yyyy")

With the intention of getting a 09-22-2021 result. However, my result turned out to be 10-22-2021
Title: Re: text field with a day counter or "Return by Date"
Post by: JohnK on September 08, 2021, 07:45:36 PM
Not quite the result I was expecting. I edited to this...

Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),"MM-DD-yyyy")

With the intention of getting a 09-22-2021 result. However, my result turned out to be 10-22-2021

I think you want:
Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),MO-DD-YYYY)
  2.  
Title: Re: text field with a day counter or "Return by Date"
Post by: jlogan02 on September 09, 2021, 04:12:21 PM


I think you want:
Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),MO-DD-YYYY)
  2.  
[/quote]

Giving it a shot. Will let you know tomorrow.
Title: Re: text field with a day counter or "Return by Date"
Post by: Lee Mac on September 10, 2021, 01:49:09 PM
Not quite the result I was expecting. I edited to this...

Code - Auto/Visual Lisp: [Select]
  1. $(edtime,$(+,$(getvar,date),14),"MM-DD-yyyy")

With the intention of getting a 09-22-2021 result. However, my result turned out to be 10-22-2021

I would suggest consulting the documentation (http://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-F94A885A-4DA2-432B-AC1A-EB49CC6C1C72) for the DIESEL edtime function in order to understand the appropriate value to use for the picture argument. As noted in the documentation, "MM" will yield the number of minutes.
Title: Re: text field with a day counter or "Return by Date"
Post by: JohnK on September 10, 2021, 01:56:05 PM
Do not wrap your MO-DD-YYYY in quotes.

Quote
<snip>The following example uses the date and time from the preceding table. Notice that the comma must be enclosed in quotation marks because it is read as an argument separator.
Title: Re: text field with a day counter or "Return by Date"
Post by: jlogan02 on September 10, 2021, 06:31:24 PM
I would suggest consulting the documentation (http://help.autodesk.com/view/ACD/2018/ENU/?guid=GUID-F94A885A-4DA2-432B-AC1A-EB49CC6C1C72) for the DIESEL edtime function in order to understand the appropriate value to use for the picture argument. As noted in the documentation, "MM" will yield the number of minutes.

My bad, I was looking at this.

Do not wrap your MO-DD-YYYY in quotes.

Quote
<snip>The following example uses the date and time from the preceding table. Notice that the comma must be enclosed in quotation marks because it is read as an argument separator.

Understood.

Thanks to both of you. I'll check my results Monday.