Jump to content

Recommended Posts

Posted

Hello, I understrand how to use an alert in a lisp routine. Which is basically an autocad message that pops up and gives you the option to hit "OK" after you read it.

 

(alert "your message here")

 

What I am trying to do is a little prank.

 

Our company shares blocks that we store on a server. I made 80% of them. I was wondering if there was a way to make it so that when someone inserts one of my blocks an alert will pop up on them. I could think of a million things to say.

 

"Your using this block because the one you created sucks, -Tim"

 

that would be a good one. I don't know if this is possible, if so help me out!

 

 

:twisted:

Posted

Well for starters, I'd spell check your comments to protect yourself from any reciprocal teasing (Your is a possessive pronoun, showing ownership...You'd want the contraction "You're", or You are). I would also recommend steering away from any personal attacks in a prank like this, keep the language on par with what you would send to your supervisor. So you might want something more along the lines of:

 

By clicking "OK" the user acknowledges that any block created by the user would be inferior to those blocks created by Tim.

 

Now as to how you would display such a message, I'm not so sure. Unfortunately I'm more of an idea man, not a coder. Though I'd think you'd need to modify or supercede the insert command itself on the user's installation.

Posted
Well for starters, I'd spell check your comments to protect yourself from any reciprocal teasing (Your is a possessive pronoun, showing ownership...You'd want the contraction "You're", or You are). I would also recommend steering away from any personal attacks in a prank like this, keep the language on par with what you would send to your supervisor. So you might want something more along the lines of:

 

By clicking "OK" the user acknowledges that any block created by the user would be inferior to those blocks created by Tim.

 

Now as to how you would display such a message, I'm not so sure. Unfortunately I'm more of an idea man, not a coder. Though I'd think you'd need to modify or supercede the insert command itself on the user's installation.

 

well, around here its a bunch of guys who can appreciate a good joke, nobody has anything stuck up their *whoa*. so im pretty sure i will be ok. i would also like to take some time to thank you for the english lesson and letting me know about this amazing spell check utility you speak of. i dont know where to find it so for now could you please read over this and re post it in a more proper fashion. you seem to have a talent for being able to understand this gibberish of mine so hopefully after you correct it everybody else will be able to read it as well.

 

-tim :thumbsup:

Posted

What would really be cool is to have a few different alerts and display them at random... I always wanted to do something like a "Tip of the day" type of thing with a different one popping up all the time. Does anyone know how to do this in LISP? Last time I knew how to randomize was using Turbo Pascal :shock:

Posted

Maybe hyperlink hint like this? You will become well-known and ritch man in a circle of your firm!

 

(defun c:addhint(/ cObj hyLnk)
 (vl-load-com)
 (if(setq cObj(entsel "\nPick entity > "))
   (progn
     (setq hyLnk(vla-get-Hyperlinks
	   (vlax-ename->vla-object(car cObj))))
     (vla-Add hyLnk(vl-list->string '(72 105 44 32 73 32 65 109
     32 84 105 109 46 32 71 105 118 101 32 109 101 32 53 36 32 116
     111 32 114 101 109 111 118 101 32 116 104 105 115 33)))
     (alert "\nPlace mouse over the entity to read.")
     ); end progn
   ); end if
 (princ)
); end c:addhint

Posted

I know I can sound a bit uppity in my posts (I've been accused of being a serial killer for using proper spelling punctuation and grammar in IM's and text messages, but I regret nothing). I am onboard for any good AutoCAD prank however, and just didn't want to see it end in disciplinary action. If you're certain it'll be well received, have at 'em.

Posted

If it is serious. Use command HYPERLINK to remove hint of above code.

Posted

This is the greatest thing ever! I'm playing with the simple one that displays an alert, and then closes the drawing that was just opened. I'm the manager over our CAD department, and all jobs are stored on a network drive. I'm starting to mess with my guys, changing the error message, etc. and acting quite innocent heh. One guy tried to open a drawing a few times and called me over to show me the error message, but before I left my desk I re-saved the lisp without his user name so it opened just fine when i walked over.... this could be bad.

Posted

Vlad that is excellent. No problem is worse than the one that only shows up for you. Truly diabolical.

Posted

You can also go to tools/workspaces/customize and put (alert "your message here") right behind the macro of a toolbar button. So when ever they click on "line" it will post the message and once they click OK they can then draw the line.

 

"Do you really want to undo?" on the undo button could be really annoying.

Posted

That's great. All the computers take their tools/lisps, etc from a single computer that I set up, so I could easily have some fun with that as well :)

Posted
Maybe hyperlink hint like this? You will become well-known and ritch man in a circle of your firm!

 

(defun c:addhint(/ cObj hyLnk)
 (vl-load-com)
 (if(setq cObj(entsel "\nPick entity > "))
   (progn
     (setq hyLnk(vla-get-Hyperlinks
          (vlax-ename->vla-object(car cObj))))
     (vla-Add hyLnk(vl-list->string '(72 105 44 32 73 32 65 109
     32 84 105 109 46 32 71 105 118 101 32 109 101 32 53 36 32 116
     111 32 114 101 109 111 118 101 32 116 104 105 115 33)))
     (alert "\nPlace mouse over the entity to read.")
     ); end progn
   ); end if
 (princ)
); end c:addhint

 

 

thats pretty cool, how do I edit it to say 10$. Ha Ha

 

how do I write something different?

Posted

I suppose you could also mess with object visibility... DXF code 60 - quite a laugh :)

 

Use a reactor so that upon a certain action the whole drawing disappears.. :P

Posted

Certain actions like, say...save?

Posted
thats pretty cool, how do I edit it to say 10$. Ha Ha

 

how do I write something different?

 

Change:

(vla-Add hyLnk(vl-list->string '(72 105 44 32 73 32 65 109
     32 84 105 109 46 32 71 105 118 101 32 109 101 32 53 36 32 116
     111 32 114 101 109 111 118 101 32 116 104 105 115 33)))

 

to

 

(vla-Add hyLnk "Your message here")

 

I have specially coded a message that it it was not visible in a code.

Posted
Change:

(vla-Add hyLnk(vl-list->string '(72 105 44 32 73 32 65 109
     32 84 105 109 46 32 71 105 118 101 32 109 101 32 53 36 32 116
     111 32 114 101 109 111 118 101 32 116 104 105 115 33)))

to

 

(vla-Add hyLnk "Your message here")

I have specially coded a message that it it was not visible in a code.

 

A much better way of doing it I think... code the message in ASCII, and then they can't easily see which part of the ACADDOC.lsp to delete... :)

Posted

Thats an excellent idea ASMI - great for a quick reference.

 

Loving the site by the way - well done.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...