Author Topic: Message Window Pop-up  (Read 11127 times)

0 Members and 1 Guest are viewing this topic.

Artisan

  • Guest
Message Window Pop-up
« on: September 08, 2005, 02:06:25 PM »
I have looked through some of the older threads, but I couldn't really find anything that answered my question, so I wanted to ask again.

We are in a situation where after coming into my new estimating position, I am finding numerous errors in the plans being submitted by our current CAD department. The method I use to notify the architectural manager of the problems is by shooting him an email about the problems. I don't know if that is going any further because I am still catching some issues.

My idea is to open our master drawings and use a LISP routine or something else that will pop up an information window when the next user opens the drawing. In this window, I was going to list out the errors that needed to be corrected prior to copying the file over for the next project. Since our projects come from our master files, these are the drawings that would have this "data window". The window would list the errors needed to be corrected and then after they are corrected, the user could take the window off of the file as a way to indicate the errors were corrected. My thought process is that this would be a LISP of some sorts that runs when a person opens the file. The first thing they see in the file would be this window popping open and telling them to correct some issues. Am I correct in thinking that this would be possible or is there a feature that is available already that I have overlooked in ADT? Any help or guidance would greatly be appreciated.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Message Window Pop-up
« Reply #1 on: September 08, 2005, 02:08:54 PM »
Not that I am aware of, but if it were comprehensive enough, it would be a really good tool to develop.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #2 on: September 08, 2005, 02:26:29 PM »
Not that I am aware of, but if it were comprehensive enough, it would be a really good tool to develop.

Well then, where do we get started on such an item? Is there a way to make a LISP routine run when a specific drawing is opened? I was thinking that LISP routines are drawing session limited. Would this be a Script routine instead? If so, how does one get dialog boxes to pop up with Scripts since they work from the command line?
« Last Edit: September 08, 2005, 02:35:05 PM by Artisan »

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #4 on: September 09, 2005, 09:12:02 AM »
Take a look at these..

http://www.theswamp.org/forum/index.php?topic=1707.0

http://www.theswamp.org/forum/index.php?topic=1193.0

http://www.theswamp.org/forum/index.php?topic=1691.0

http://www.theswamp.org/forum/index.php?topic=1342.0


MP's idea seems to be very close to what I am looking for. I tried Marks LISP routine, but I couldn't get the VLX file to work because I have never used one of those files. :-(  Anyway, thanks for the help so far, it appears that I am getting closer to something that may exist.

kozmos

  • Newt
  • Posts: 114
Re: Message Window Pop-up
« Reply #5 on: September 09, 2005, 09:46:16 AM »
I think your purpose can be done very simple by a special steeings:
1) Locate a data file on a special net PC, predefine the file name and the data format. Of coz, only persons who have the rights can modify the data file.
Example:
Filename: \\ServerPC\Notice\Data.TXT
FileContent
[DWGNAME1]
Enter your comments for DWG1 in this line
[DWGNAME2]
Enter your comments for DWG2 in this line

2) Defines a function to read the special  data file (if it is exist)
(Defun  Read-Notify()
 (if (and  (setq txt (findfile "\\\\ServerPC\\Notice\\Data.TXT")
            (setq fil (read txt "r"))
     )
     (while (setq lin (read-line fil))
       (if (= lin (strcat "[" (getvar "DWGNAME") "]")
          (alert (read-line lin))
       )
     )
     (close fil)
)

3) Add the function to function S::Startup in former ACADDOC.LSP or ACAD.LSP

Then people will read the notice message when the DWG is open, unless you modified the dat file.

If you only want certain user can see the alert message, just a little modification on data file and lisp code and I think it is also can be done very easy based on these settings.
« Last Edit: September 09, 2005, 09:49:28 AM by kozmos »
KozMos Inc.

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #6 on: September 09, 2005, 10:25:15 AM »
I think your purpose can be done very simple by a special steeings:
1) Locate a data file on a special net PC, predefine the file name and the data format. Of coz, only persons who have the rights can modify the data file.
Example:
Filename: \\ServerPC\Notice\Data.TXT
FileContent
[DWGNAME1]
Enter your comments for DWG1 in this line
[DWGNAME2]
Enter your comments for DWG2 in this line

2) Defines a function to read the special  data file (if it is exist)
(Defun  Read-Notify()
 (if (and  (setq txt (findfile "\\\\ServerPC\\Notice\\Data.TXT")
            (setq fil (read txt "r"))
     )
     (while (setq lin (read-line fil))
       (if (= lin (strcat "[" (getvar "DWGNAME") "]")
          (alert (read-line lin))
       )
     )
     (close fil)
)

3) Add the function to function S::Startup in former ACADDOC.LSP or ACAD.LSP

Then people will read the notice message when the DWG is open, unless you modified the dat file.

If you only want certain user can see the alert message, just a little modification on data file and lisp code and I think it is also can be done very easy based on these settings.


Does this open on activation of the specific drawing? That's where I am getting lost on this idea, plus the fact that I lack the programming knowledge. My thought is for a command to run when I open the specific drawing. This command will pop up a dialog box to tell the user that this specific drawing has some errors that need to be corrected prior to proceeding. After the user makes those changes, then the user will have to clean out the command so it doesn't pop up again in the future. The person making the notes for the specific drawing would also have to have an easy way of creating the notes for that DWG and then somehow tie that data file with the notes to that specific DWG in a way that it will pop up when the specific DWG is opened. I just don't know how a command can be run when you open a DWG. I understand the principle behind running a script at the start of ACAD itself, but not one for a DWG. Sorry for the lack of understanding here. Thanks for the help so far, it's giving more information to base my question on though.

deegeecees

  • Guest
Re: Message Window Pop-up
« Reply #7 on: September 09, 2005, 10:36:51 AM »
Quote
Does this open on activation of the specific drawing?

Take a look at AutoCads startup functions:

acad.dvb
acad200(version)doc.lsp

Personally, I would put this in a .dvb file and load/run it with each drawing.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Message Window Pop-up
« Reply #8 on: September 09, 2005, 11:21:16 AM »
Well what would do is this: :-D

Create a routine to run at start up, put it in ACADdoc.lsp
The routine would find the xData notes & display them.


Use Marks routine for Job notes to edit the notes in xData
These notes are kept in each drawing so they are specific to that drawing.
« Last Edit: September 09, 2005, 12:34:06 PM by CAB »
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

LE

  • Guest
Re: Message Window Pop-up
« Reply #9 on: September 09, 2005, 11:47:32 AM »
Hi,

I just wrote this routine, have a look and see if it is in any help for you.

Place the code inside of your acad.mnl or acaddoc.lsp

Please, read the inline descriptions.... HTH

Luis.

Code: [Select]
(vl-load-com)

;; creates a dummy file
(defun dummyfile  (filename / fp)
  (if (not (findfile filename))
    (progn
      (setq fp (open filename "w"))
      (close fp))))

;; here at the opening of a drawing
;; it will read if it has a popupnote
;; and if it does, it will show it for the user
(defun on-open (reactor params)
  (if (and (= (vlax-ldata-get "POPUPNOTE" "NOTE") "1") (not flag))
    (progn
      (vlax-ldata-put "POPUPNOTE" "NOTE" "0")
      (startapp "notepad.exe"
(strcat "\""
(getvar "dwgprefix")
(vl-filename-base (getvar "dwgname"))
".txt\"")))))

;; it will create or open an existing filename
(defun make-note  (filename)
  (dummyfile filename)
  (startapp "notepad.exe" (strcat "\"" filename "\"")))

;; a reactor to manage at opening of a drawing/document
(if (not popup_reactor)
  (setq popup_reactor
(vlr-docmanager-reactor
   "popup notes"
   '((:vlr-documentLockModeWillChange . on-open)))))

;; use at the command line
;; Command: POPUP-NOTE
;; make the annotations and save/close the .TXT file
(defun C:POPUP-NOTE  ()
  (if (= (getvar "dwgtitled") 1)
    (progn
      (vlax-ldata-put "POPUPNOTE" "NOTE" "1")
      (setq flag t)
      (make-note (strcat (getvar "dwgprefix")
(vl-filename-base (getvar "dwgname"))
".txt"))))
  (princ))

(princ)

deegeecees

  • Guest
Re: Message Window Pop-up
« Reply #10 on: September 09, 2005, 01:13:40 PM »
Nice job Le. The only improvement would be to set the focus to "Notepad". I use a dos_splash screen with the company logo here (the owner loves it), and I think its taking the focus away from "Notepad".

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Message Window Pop-up
« Reply #11 on: September 09, 2005, 01:34:35 PM »
Luis,
A very versatile solution.
Thanks for the code.. :-)

CAB
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

LE

  • Guest
Re: Message Window Pop-up
« Reply #12 on: September 09, 2005, 01:39:04 PM »
Nice job Le. The only improvement would be to set the focus to "Notepad". I use a dos_splash screen with the company logo here (the owner loves it), and I think its taking the focus away from "Notepad".

Yep.... there is a way to force it.... I just posted a simple solution, I have another routine that uses objectdcl dialog, and does basically the same, with more features.

Have fun,
Luis.

LE

  • Guest
Re: Message Window Pop-up
« Reply #13 on: September 09, 2005, 01:39:38 PM »
Luis,
A very versatile solution.
Thanks for the code.. :-)

CAB

Great.... !

Thanks.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Message Window Pop-up
« Reply #14 on: September 09, 2005, 01:45:01 PM »
Yep, characteristically eloquent Mr. Esquivel.

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