I'm looking for lisp routine that returns the date in format mm/dd/yy
and time like 12:00:00.
Mike Cundiff
Utilities, Inc.
www.pivot.net/~cadmike
You can easily do this with a DIESEL string:
(defun c:today ()
(menucmd "M=$(edtime,$(getvar, date),MM/DD/YY - HH:MM:SS)")
)
If you would like to use other format phrases, look at "DIESEL-String
Expression Language" in the AutoCAD Customization Manual.
Hope this helps.
--
Chris
*********************************************
Christoph Candido
E-Mail: h854...@edv1.boku.ac.at
University of Agricultural Sciences
Vienna, Austria
*********************************************
>Hi all,
>
>I'm looking for lisp routine that returns the date in format mm/dd/yy
>and time like 12:00:00.
>
>
>Mike Cundiff
>Utilities, Inc.
>www.pivot.net/~cadmike
These just print the values on the command line, the values are not
saved anywhere.
(defun c:today ( / now yy mm dd)
(setq now (rtos (getvar "cdate") 2 6)
yy (substr now 3 2)
mm (substr now 5 2)
dd (substr now 7 2)
)
(princ (strcat "\n" mm "/" dd "/" yy))
(princ)
)
(defun c:ctime ( / now hr min sec)
(setq now (rtos (getvar "cdate") 2 6)
hr (substr now 10 2)
min (substr now 12 2)
sec (substr now 14 2)
)
(princ (strcat "\n" hr ":" min ":" sec))
(princ)
)
-Jim Fitzgerald
>Hi all,
>I'm looking for lisp routine that returns the date in format mm/dd/yy
>and time like 12:00:00.
>Mike Cundiff
>Utilities, Inc.
>www.pivot.net/~cadmike
You are Utilities, Inc. and YOU want a utility so that I assume you
can sell. I've got an idea, why don't you
1. Learn how to do it yourself.
2. Pay someone to do it, seeing as you are going to sell it.
I'm trying not to get pissed off here, but it's pretty difficult.
Private Ice
Hi,
The devil won't sleep. There is a bug in my LISP routine, though it's
only one line long. A date like "45/28/97 - 15:45:12" doesn't look
very good. Sorry, there is one M too much (M stands for Month, MM for
Minutes).
Here is the corrected version:
(defun c:today ()
(menucmd "M=$(edtime,$(getvar,date),M/DD/YY - HH:MM:SS)")
)
Sorry again,
and Happy Easter
Chris
--
Or,
3. Look up edtime in the DIESEL section of the Customization
Guide.
--
B. Rustin (Rusty) Gesner -- Group A --
AutoCAD.Expert.Consultant.Author.Editor (reply to ru...@group-a.com)
Co-author of Maximizing AutoCAD R13 (now available) &
Maximizing AutoLISP for AutoCAD R13 & R14 (available after R14 -- late
Summer) See http://www.group-a.com/~rusty for info or to BUY A BOOK
Spammers: e-mails not DIRECTLY concerning the primary topics of this
newsgroup will be considered unsolicited, traced, and forwarded to your
ISP for cancellation of your account. Go ahead, make my day!
>cad...@pivot.net (Mike Cundiff) wrote:
.....
message deleted ,.....
>>Mike Cundiff
>>Utilities, Inc.
>>www.pivot.net/~cadmike
> You are Utilities, Inc. and YOU want a utility so that I assume you
>can sell.
"Utilities" means more than simply addons to a piece of software. There are
electric utilities, there are water and sewer utilities ... etc. Few of these
are, to my knowedge, in the business to sell software.
> I've got an idea, why don't you
> 1. Learn how to do it yourself.
One of the biggest advantages of a medium like this is to share what we've
learned from others in a like manner. I'm greatful to the likes of the AutoLISP
pros that frequent this group and offer their help to the rest of us asking
nothing in return. I'm somewhat confident that they also learned much of what
they know in a similar manner. Thus rather than simply blowing someone off with
that kind of a statement, give some guidance on how to get started. It's not
necessary to solve the problem entirely but a little advice on how the pieces
fit together would go a lot further towards helping out.
> 2. Pay someone to do it, seeing as you are going to sell it.
You have nothing to base that on that I can see from the original post.
> I'm trying not to get pissed off here, but it's pretty difficult.
I fail to see any reason to be pissed off, or even slightly annoyed.
> Private Ice
Most professionals post in this group with a real name.
Dennis Shinn
Seattle AutoCAD User Group
CAD Systems manager/GLY Construction
Part No. ||| ||||| || ||||||