PDA

View Full Version : send an alert with .dwl


clovis
2008-02-20, 08:42 AM
Hello,
I'd like to send a message to a computer/user based on the drawing.dwl
in or outside Autocad.
Any idea?
Thanks

ccowgill
2008-02-20, 01:08 PM
this has been discussed before (http://forums.augi.com/showthread.php?p=287423&highlight=alert#post287423), you could try to figure out a way to determine who has the drawing open, and somehow get outlook to send an email, but I believe there is no way to get a message box to pop up on the screen of the person that has the drawing open you want to get into.

jguest
2008-02-21, 03:30 AM
.....I believe there is no way to get a message box to pop up on the screen of the person that has the drawing open you want to get into.

Not entirely true, but it does depend on how your network is configured, and what rights you have on your network. If you have the appropriate permissions you can (or at least you used to be able to) send a console message to another user which would pop up on top of whatever they were looking at. I can't remember the detail on how to do it, but I do remember doing it. I sus[ect that you could manipulate this functionality with a bit of advanced knowledge of the Windows API.

I think, though, that console messages require administrative access so if you don't have that on your local machine then it could be more difficult.

irneb
2008-02-21, 04:34 AM
Come across this doing a Google search: http://www.thescripts.com/forum/thread585744.html
Thus you can either do it through VBA (or VLAX) or simply using:
(command "_shell" (strcat "net send \"" computername "\" \"" message "\""))Please note you'll have to ensure that the Messenger service is started on each computer on the network, otherwise this won't work. Follow the instructions in the link.

irneb
2008-02-21, 08:35 AM
Here's the code without having WHOHAS loaded:
(defun c:WhoHasSend (/ fn f s user comp)
(if (setq fn (getfiled "Select Drwaing to Check" (getvar "DWGPREFIX") "dwg" 0))
(progn
(setq fn (strcat (vl-filename-directory fn) "\\" (vl-filename-base fn) ".DWL"))
(if (findfile fn)
(progn
(setq f (open fn "r"))
(setq user (vl-string-trim " \t\n" (read-line f)))
(setq comp (vl-string-trim " \t\n" (read-line f)))
(close f)
(setq s (strcat "Hi " user ", You've got drawing " (vl-filename-base fn) " open. Could you please close? Sent by: " (getenv "username")))
(command "_shell" (strcat "net send \"" comp "\" \"" s "\""))
(alert (strcat "The following message sent:\n\n" s))
)
(progn
(alert "No-one seems to have the drawing open.")
)
)
)
)
(princ)
)

ccowgill
2008-02-21, 12:52 PM
Not entirely true, but it does depend on how your network is configured, and what rights you have on your network. If you have the appropriate permissions you can (or at least you used to be able to) send a console message to another user which would pop up on top of whatever they were looking at. I can't remember the detail on how to do it, but I do remember doing it. I sus[ect that you could manipulate this functionality with a bit of advanced knowledge of the Windows API.

I think, though, that console messages require administrative access so if you don't have that on your local machine then it could be more difficult.

you are correct, I believe that was discussed in the thread I provide a link to, or I remember hearing this before somewhere.

jguest
2008-02-21, 10:22 PM
you are correct, I believe that was discussed in the thread I provide a link to, or I remember hearing this before somewhere.

Nope, not in that thread. But you're right, I have a distinct memory of it being discussed here on AUGI before. I think one of the biggest hassles was that a lot of corporate networks turn off the messenger service, or something along those lines.

Terry Cadd
2008-02-21, 11:45 PM
Hi,
Here is a Messenger program that we have a lot of fun with at work. It's not specific to drawings that are opened, but just a general messenger between co-workers using AutoCAD.

AutoCAD Messenger uses the Windows Messenger Service to send and receive messages between AutoCAD users on a network or server. Messenger requires a few installation steps, such as customizing the global variables *Shared_Folder$, *Login_Exceptions@, and *Login_Displayname@. The associated files are Messenger.lsp, and Messenger.dcl.

The files are located on the following link in the AutoCAD Messenger area.
http://web2.airmail.net/terrycad/AutoLISP-Code.htm

http://web2.airmail.net/terrycad/Images/Messenger.jpg

clovis
2008-03-17, 09:11 AM
That's a lot of information to work with ;-)
Thank you very much to all !!