viviancarvalho Posted November 23, 2010 Posted November 23, 2010 Hi to all Can a lisp can be time bound ? To be more specific i want a lisp, not to run after a certain date or time. It could be sounding funny but i just want to know its possibilities. Thanks & regards Vivian. Quote
pBe Posted November 23, 2010 Posted November 23, 2010 put something like this.. (if (< (rtos (getvar "cdate") 2 0) "20101215") ( ..... run routine) (Alert "Contact pBe for Renewal") ) I assume you meant "time bomb"? Why would you do that? Quote
viviancarvalho Posted November 23, 2010 Author Posted November 23, 2010 put something like this.. (if (< (rtos (getvar "cdate") 2 0) "20101215") ( ..... run routine) (Alert "Contact pBe for Renewal") ) I assume you "time bomb" Why would you do that? Thank you very much. I know its a strange thing,but i have to do it. We are offloading one of our jobs fully to one of our sub contractors. I want them to maintain the same quality of our drawings, at the same time i dont want him to use it for himself.......:wink: Regards Vivian. Quote
pBe Posted November 23, 2010 Posted November 23, 2010 Thank you very much.I know its a strange thing,but i have to do it. We are offloading one of our jobs fully to one of our sub contractors. I want them to maintain the same quality of our drawings, at the same time i dont want him to use it for himself.......:wink: Regards Vivian. Of course it would help if they cant see that part of the code so compiled lisp is what you need FAS or VLX Good luck c",) Quote
viviancarvalho Posted November 23, 2010 Author Posted November 23, 2010 Of course it would help if they cant see that part of the code so compiled lisp is what you need FAS or VLX Good luck c",) It is already a fas file but it would stay with him forever. That is why i want it to expire. Quote
JohnM Posted November 23, 2010 Posted November 23, 2010 If you don’t trust them have them sign an agreement. You might not be able to do what you want in lisp. If they don’t have a full version of AutoCAD the program will not run. If they are allowed to edit the cad files then they can copy the file and bypass any code. I believe this topic has been posted before, try a search for the topic and you might find some helpful tips before spending time writing a lot of code. Security codes and written agreements will only keep the honest crooks out, if there is a will there is a way. Quote
BIGAL Posted November 24, 2010 Posted November 24, 2010 (edited) Why are you giving the sub contractor the lisp in the first place ? Are you just saving him time and money. If its to do with drawing standards then make that part of the contract that they must draft to your standards without the lisp or buy yours. Also been there done that had the phone call program won't work at a mates house. Ask the contractor for his serial number "_pkser" add that as well stops the date being reset to work and handing it to some else. Edited November 24, 2010 by BIGAL serial number Quote
viviancarvalho Posted November 24, 2010 Author Posted November 24, 2010 Thanks Guys for all the help. Quote
CAD_Noob Posted January 3, 2018 Posted January 3, 2018 Sorry to bump this old thread. Where in the lisp do i need to post the code that pBe posted? Can somebody be kind enough to put comments on that code so i can now what it does and how to put the so called expiration date? Quote
BIGAL Posted January 3, 2018 Posted January 3, 2018 Put it at the very start of your lisp. If your not making a fas then your wasting your time. ; this is for two weeks from today year month day (if (> (rtos (getvar "cdate") 2 0) "20180117") (progn (Alert "Contact pBe for Renewal") (exit) ; exit lisp routine ) (princ "\nOK") ) Quote
CAD_Noob Posted January 3, 2018 Posted January 3, 2018 Thanks Bigal, is it after the (defun c: ....) Quote
benhubel Posted January 3, 2018 Posted January 3, 2018 If you are at all concerned about them finding workarounds, there are lots of methods of making the time limit more difficult to get past. You could set the program to delete or overwrite itself after the deadline, that way they can't spoof the time limit as easily unless they know ahead of time that it will behave that way. Another method is for it to log the current date. In addition to a cutoff date, make the program refuse to run if it senses any time traveling (if the current date is earlier than any one of the past logged dates). Quote
CAD_Noob Posted January 5, 2018 Posted January 5, 2018 I'm getting a ; error: quit / exit abort after running the code. Quote
BIGAL Posted January 5, 2018 Posted January 5, 2018 So what did it exit ? I changed to "20180101" and it exited which is what it supposed to do Quote
kirby Posted January 5, 2018 Posted January 5, 2018 Both (exit) and (quit) commands return the "; error: quit / exit abort" message by design. Add a small error trap to hide from user if desired. Quote
BIGAL Posted January 6, 2018 Posted January 6, 2018 Like Kirby you would do some form of elaborate message before the (exit) For a laugh just wait for sound, I will find better version. (defun SpeakSapi ( s / sapi ) (if (eq (type s) 'STR) (progn (setq sapi (vlax-create-object "Sapi.SpVoice")) (vlax-put sapi 'SynchronousSpeakTimeout 1) (vlax-invoke-method sapi 'WaitUntilDone 0) (vlax-invoke sapi "Speak" s 0) (vlax-release-object sapi) ))) (speaksapi "Welcome from BIG al the humour and respect you can expect here at Cad tutor") (speaksapi "PLEASE PAY YOUR MONEY") (speaksapi "I know you have wound the clock back" ) (speaksapi "Call me on 1234 5678 if you like the software") Quote
CAD_Noob Posted August 8, 2018 Posted August 8, 2018 I still don't know where in the lisp will i put it... (defun c:Sample ()( ) (princ) ) need assistance... thanks! Quote
BIGAL Posted August 8, 2018 Posted August 8, 2018 Just add the check after the defun line at the start, particuarly if you autoload it at start up. Even above it if you demand load it from say a menu. Quote
CAD_Noob Posted August 8, 2018 Posted August 8, 2018 (edited) so it will look something like this? (defun c:SAMPLE () (if (> (rtos (getvar "cdate") 2 0) "20180117") (progn (Alert "Contact pBe for Renewal") (exit) ; exit lisp routine ) (princ "\nOK") ) (<blah blah) (princ) ) Edited August 16, 2018 by SLW210 Changed Quote Tags to Code Tags Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.