TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: El Bachaco on November 12, 2014, 10:44:58 AM
-
Greetings friends .... I can include you as a lisp routine that run only a certain time ..... thanks for the help and your time .......!
-
You want to know how to run a lisp routine at a certain time of the day?
-
hi chris ..... I want the routine is executed only eg for a month.......
-
So it runs for a month and stops?
-
yes.....Chris.....
-
Would probably just be easier to make an Outlook reminder to unload the routine.
(defun c:WantsTheD
(/ currentD FutureD
) FutureD
(rtos 20141212.00000000 2 8) )
(< currentD futureD)
)
)
But here is my stab
-
hey Chris thank you very much ....... I write to try ....
-
What is the purpose? Sounds like a trial period or register for a full version?
-
yes .... is a routine test metal structure .... thanks for your interest Chris
-
This isn't really a valid way to do that. You'd have to manually edit the LISP routine before you sent it out. You could look into registry edits and creating keys on first run. I'd suggest submitting it through the AutoDesk exchange, from what I understand they incorporate purchases / trials. I could be wrong though.
-
Chris ....... I am from Venezuela, Latin America, and the routine is to work at the company where I work and putting on parole for that company policy .....!
-
to start, look up the DATE system variable in AutoCAD help.
next, investigate these functions:
Have fun. :)
-
many thanks hermanm.....
-
The DATE solution suggested may not work if the user changes system date.
Is there any other fool proof method ?
-
The DATE solution suggested may not work if the user changes system date.
Is there any other fool proof method ?
one can query internet time
-
The DATE solution suggested may not work if the user changes system date.
Is there any other fool proof method ?
one can query internet time
Yes Good Option, What is the LISP code to query internet time ?
-
Yes Good Option, What is the LISP code to query internet time ?
http://www.theswamp.org/index.php?topic=33065.0
(vk_ReadXML "http://developer.yahooapis.com/TimeService/V1/getTime?appid=YahooDemo")
(defun vk_UnixTime2AcadTime (u) (+ 2440588.0 (/ u 86400.0)))
-
The DATE solution suggested may not work if the user changes system date.
Is there any other fool proof method ?
one can query internet time
Yes Good Option, What is the LISP code to query internet time ?
Another:
http://www.theswamp.org/index.php?topic=39491.msg447974#msg447974
-
nice job, Lee.:)
Note that NIST:
http://tf.nist.gov/tf-cgi/servers.cgi
is recommending ntp as replacement for the old "DAYTIME" protocol
thus:
(setq server
"ntp://time.nist.gov/");newer protocol
works here.
@ mailmaverick:
yes, true enough.
by default, though, Windows systems are set to sync with a time server
so, it takes a conscious act to de-sync system time,
which would result in all local time stamps becoming inaccurate.
Is it likely someone would do that, just to run an expired AutoLISP demo?
I think not, but perhaps I am mistaken.
In any case, locks only keep out the honest folks.
JMO.
-
nice job, Lee.:)
Note that NIST:
http://tf.nist.gov/tf-cgi/servers.cgi
is recommending ntp as replacement for the old "DAYTIME" protocol
thus:
(setq server
"ntp://time.nist.gov/");newer protocol
works here.
Many thanks Herman :-)
I haven't revisited the code in 3 years (wow - that's gone by fast!), so thank you for the heads-up on the new server url.
Lee
-
thanks guys for all your help .....!
-
I was wondering if querying internet time is possible then finally end up to this nice thread. Thanks to everyone.
I tried Lee's code but find this does not work:
(setq server "ntp://time.nist.gov/")
unless use the old one:
(setq server "http://time.nist.gov:13")
And the page is not exist anymore:
http://tf.nist.gov/tf-cgi/servers.cgi
Can you please confirm if the 2nd one above is still correct?
Many thanks.
-
there's yet another way to query internet time
(defun vk_GetRemoteFileHeaders (RemoteFileName Headers / objHTTP Result)
(if (setq objHTTP (vlax-create-object "WinHTTP.WinHTTPRequest.5.1"))
(progn (setq Result (vl-catch-all-apply
(function
(lambda ()
(vlax-invoke-method objHTTP "Open" "HEAD" RemoteFileName :vlax-false)
(vlax-invoke objHTTP "Send")
(if (= (vlax-get-property objHTTP "Status") 200)
(mapcar (function (lambda (h / r)
(setq r (vl-catch-all-apply
'vlax-invoke-method
(list objHTTP "GetResponseHeader" h)
)
)
(cons h
(if (not (vl-catch-all-error-p r))
r
)
)
)
)
Headers
)
)
)
)
)
)
(vlax-release-object objHTTP)
(if (and Result (not (vl-catch-all-error-p Result)))
Result
)
)
)
)
(defun vk_GetInternetTime (/)
(cdar (vk_GetRemoteFileHeaders "http://www.google.com" (list "Date")))
)
any server can be used, even http://www.theswamp.org :)
-
While any VL Application can be decompiled you cannot protect it any code you write
-
friends ..... thank you very much to all of you for your work and time.......
-
While any VL Application can be decompiled you cannot protect it any code you write
How can a VLX be decompiled into LISP code ?