Author Topic: Lisp experation  (Read 6396 times)

0 Members and 1 Guest are viewing this topic.

PitchBlack98

  • Guest
Lisp experation
« on: April 18, 2006, 08:41:19 PM »
Is there anyway to add some code to a lisp to make it expire after a certain date or time period. I have some lisp routines Im letting a friend borrow, but I want them to expire after a month or 2. I want something that will be fairly easy to setup and possible modify to allow it to run longer. Thanks in advance!

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Lisp experation
« Reply #1 on: April 18, 2006, 08:45:45 PM »
I'm sorry, the answer has expired.

 :lmao:
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #2 on: April 18, 2006, 08:51:59 PM »
lol I guess thats better than nothing...  :lol:

JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: Lisp experation
« Reply #3 on: April 18, 2006, 09:09:28 PM »
``Friend'' huh? ...I usualy ``give'' my friend's stuff.




Okay, im just teasing ya, I'll see if i can help more in the morn.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #4 on: April 18, 2006, 09:17:50 PM »
lol Ive been writing simple routines for him for a while. I just want to play with him and see what he thinks when they expire. Oh and if he tries to screw me in the future then he wont be able to use them anymore. lol... They way I see it... I do this for free and if no one wants to give a little back then they dont deserve to make money off the little people that help then out. He helps me out by giving me some drafting on the side when he cant keep up with his work load.

By the way, I got this idea from the Clock lisp that displays the cartoon clock in your CAD. I figured if it can get windows time to set itself there should be a way to add a little code to a lisp to get it to check the date and if its past a certain date then it gives an error or just doesnt work. Maybe display a message that the lisp has expired. That would be great especially if it can just be added to the top of one of my existing routines.
« Last Edit: April 18, 2006, 09:23:43 PM by PitchBlack98 »

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Lisp experation
« Reply #5 on: April 18, 2006, 09:28:22 PM »
There's a number of different things you can do, but --

"friend', "screw me", "won't be able to use them anymore"

??

I've been writing programs for over 2 decades and I've never dealt with my friends this way, let alone acquaintances. This doesn't sum correctly to me, so forgive me if I don't participate.

Gotta love democracy.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #6 on: April 18, 2006, 09:41:44 PM »
I was kidding about my friends screwing me. That line was a joke. I show my appreciation by helping people out with just about anything and a little help in return is also appreciated. I basically want to do it for security. I write a lot of routines that Id rather some people I work with either not have at all or just be able to use for a limited time.

One instance I can think of is when I wrote a routine that would make backgrounds for structural drawings out of the clients arch drawings. After it was done and working a coworker told my boss he wrote it and he got a bonus for it since it saved us so much time working with the arch files. I quit working their shortly after and have been doing freelance structural design ever since.

CottageCGirl

  • Guest
Re: Lisp experation
« Reply #7 on: April 18, 2006, 10:17:19 PM »
could you have the lisp read the computer clock when it loads??????

ps: can I assume you are a Riddick fan?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Lisp experation
« Reply #8 on: April 18, 2006, 10:19:56 PM »
You didn't take that coworker to task with your former boss? Wow.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #9 on: April 19, 2006, 12:28:22 AM »
CottageCGirl... No riddick fan here. The movies were OK, but not the best. I actually own a 1998 Mitsubishi eclipse and its solid black from nose to tail. Everything is blacked out on it. Makes it easy to hide at night. lol jk....

As for the coworker, I did say something, but didnt have anyway to prove I had written it. I always put my name and the date written in my codes, but he just changed it. I now encrypt all my codes with protect.exe that I found here. It works very well by the way... but when I called out my coworker and pointed it out to my boss it created a hostile enviroment for me to work in. I was basically look at as a liar and it was getting to the point where it was becoming very verbal in the office. Thats what caused me to leave the company I was working for and persue my own freelance design.

MP... Just dont take what I said about friends screwing me seriously. It was basically a joke. I pick and choose my friends now. and like I said Im the first person to help someone out when they ask, lisp routines or anything else. I actually knew very little about lisp routines before I started to read these forums. I learned a little in college, but not really enough to use it widely. Ive been reading here for the last year and just signed up recently when I needed to ask some questions and help further my self taught knowledge of lisp. Im going to move over to the VB section soon after I get a good handle on lisp. I appreciate you and everyone else on this very informative forum. If it wasnt for the swamp I wouldnt be using lisps today.

JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: Lisp experation
« Reply #10 on: April 19, 2006, 08:36:51 AM »
Well there are several ways you can do this. Vituraly all can be easly beaten (That's about all your gonna get with AutoLisp.).

Here is a helping hand in the right direction (well the easiest direction.).

Code: [Select]
(defun idate ()
  ;; return the date.
  ;; (idate)
  ;; 20060419 => 04.19.2006
  ;;
  ;; Stolen from somewhere im sure.
  (atoi (rtos (getvar 'cdate) 2 0)))

(if (>= (idate) 20060419)
  (alert "I will not run anymore.")
  )
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #11 on: April 19, 2006, 10:08:47 AM »
Thats cool... Ill give it a try and see if I can merge that with my existing code and see what happens. I really appreciate it.

EDIT: I added the code and got it to run before my lisp. When I set the date to make it expired it gives me the popup and after clicking OK the lisp still runs. I tried to make it exit after the popup but no luck yet. Im going to play with it some more and see if I can figure it out unless you know of a solution off the top of your head.

Thanks!
« Last Edit: April 19, 2006, 10:20:48 AM by PitchBlack98 »

JohnK

  • Administrator
  • Seagull
  • Posts: 10655
Re: Lisp experation
« Reply #12 on: April 19, 2006, 10:42:39 AM »
That's because what i gave was only a small demonstration into one theory you can use.

(exit)
(quit)
(command) (command)
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

ronjonp

  • Needs a day job
  • Posts: 7531
Re: Lisp experation
« Reply #13 on: April 19, 2006, 10:44:02 AM »
Try this:

Code: [Select]
(defun idate ()
  ;; return the date.
  ;; (idate)
  ;; 20060419 => 04.19.2006
  ;;
  ;; Stolen from somewhere im sure.
  (atoi (rtos (getvar 'cdate) 2 0))
)
(if (>= (idate) 20060419)
  (progn
   
   ;;Insert your code here
   
  )
  (alert "I will not run anymore.")
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

PitchBlack98

  • Guest
Re: Lisp experation
« Reply #14 on: April 19, 2006, 10:52:23 AM »
I got it to work using exit a little bit ago. I was looking at it the wrong way and trying to use a cancel command to exit it. All is good now and it works perfectly. Thanks.