Author Topic: cdate...  (Read 1663 times)

0 Members and 1 Guest are viewing this topic.

MeasureUp

  • Bull Frog
  • Posts: 465
cdate...
« on: January 21, 2013, 12:37:44 AM »
I just noticed that I get different result with different input for the system variable "CDATE":
In the command prompt:

CDATE => CDATE = 20130121.16171928 (read only)
(getvar "CDATE") => 2.01301e+007

Any idea?

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
BTW, when I insert "code" to the following the selected texts these texts don't show color (red in the case).
Code: [Select]
CDATE => CDATE = [color=red]20130121.16171928 (read only)[/color]
(getvar "CDATE") => [color=red]2.01301e+007[/color]

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: cdate...
« Reply #1 on: January 21, 2013, 01:24:42 AM »
It's a situation of the command-line CDATE formatting the value to a string when outputting. But obtaining the value through lisp - returns a true real value instead of a string. Thus it uses the current format for outputting real values (defined through LUNITS & LUPREC).

You could of course force the same text format through the rtos function:
Code: [Select]
Command: (rtos (getvar "cdate") 2 8)
"20130121.08310296"
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.

pBe

  • Bull Frog
  • Posts: 402
Re: cdate...
« Reply #2 on: January 21, 2013, 09:10:47 AM »
I just noticed that I get different result with different input for the system variable "CDATE":
In the command prompt:

CDATE => CDATE = 20130121.16171928 (read only)
(getvar "CDATE") => 2.01301e+007

Any idea?



Curious, what are you planning to use the value for? You might want to look up the menucmd/edtime. [/size]DIESEL string expression language.

MeasureUp

  • Bull Frog
  • Posts: 465
Re: cdate...
« Reply #3 on: January 21, 2013, 05:56:40 PM »
Thanks to irneb.
And to pBe: I found the difference by chance, not using for my code. Thanks.  :-)

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: cdate...
« Reply #4 on: January 22, 2013, 08:38:49 AM »
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.