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

0 Members and 1 Guest are viewing this topic.

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #15 on: September 09, 2005, 02:22:04 PM »
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)

Many thanks LE. The routine works nicely, but I am still not getting it to run when I open a specific drawing that I have made notes on. I added the routine to my acaddoc.lsp file, but I'm not getting anything when I open a drawing. Am I missing something?

LE

  • Guest
Re: Message Window Pop-up
« Reply #16 on: September 09, 2005, 02:45:08 PM »
Hi,

Canyou tried by placing the code inside of your ACAD.MNL

Luis.

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #17 on: September 09, 2005, 02:59:11 PM »
Hi,

Canyou tried by placing the code inside of your ACAD.MNL

Luis.

I have placed the routine in my ACAD2005doc.lsp, ACAD.lsp, ACAD.mnl and my own personal mnl file. None of them will run the routine when I open the drawing that I used the routine in. For example; I used the routine for Drawing Name "XX". I added my notes to the TXT file and saved it. It saved as XX.txt, after the drawing name. I shut down ADT and restarted it. I opened drawing "XX" and nothing happened on the start. I had to type in the routine name, "popup-note" in order to see the notes that I typed in for it. Am I correct in thinking that when my drawing opens up, it automatically runs the popup-notes routine without me having to type it in?

LE

  • Guest
Re: Message Window Pop-up
« Reply #18 on: September 09, 2005, 03:04:38 PM »
... it automatically runs the popup-notes routine without me having to type it in?

Yes... ahhhhhhh hmmmm, let me think, I'll be back

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #19 on: September 09, 2005, 03:07:52 PM »
... it automatically runs the popup-notes routine without me having to type it in?

Yes... ahhhhhhh hmmmm, let me think, I'll be back


Many thanks for the help so far. Also, can you give me your name so I can tag it to the lisp routine to give you credit for it? You can IM  your name to me if you want.

LE

  • Guest
Re: Message Window Pop-up
« Reply #20 on: September 09, 2005, 03:14:34 PM »
My name is Luis Esquivel

I use LE... because I am tired to typed....  :-D

OK, back to this stuff...

Place the whole code into a new acaddoc.lsp and put that acaddoc.lsp into an new folder and that folder also make it part of the support path of autocad, but make it is above of the support folder... this is just to make sure we will be loading our acaddoc.lsp, first....

Then, open the drawing with the popup note saved and see if it working now.... I'll be whatching from here....

HTH.... here is working with no problema'

deegeecees

  • Guest
Re: Message Window Pop-up
« Reply #21 on: September 09, 2005, 03:16:19 PM »
Yes, I see...

Upon opening a drawing with the popup-note 2 times, I first got a "Command In Progress" error when closing the drawing, then the second time I got 'bupkis', 'zilch', 'nada'. Something is rotten in Denmark.

Edited: I'm using 2002 vanilla.

deegeecees

  • Guest
Re: Message Window Pop-up
« Reply #22 on: September 09, 2005, 03:21:05 PM »
On a side note:

I think I typed this in and never hit the "Post" button, but how about using very large non-plotting text on a unique layer? I know its not code, but hey its a quick fix.

LE

  • Guest
Re: Message Window Pop-up
« Reply #23 on: September 09, 2005, 03:24:15 PM »
Edited: I'm using 2002 vanilla.

I never used 2002... so it might be an issue, from autocad 2004 they fixed a lot of things, and one was related on the command in progress stuff....

LE

  • Guest
Re: Message Window Pop-up
« Reply #24 on: September 09, 2005, 03:27:57 PM »
I can write the routine in ARX, but do not have the compiler installed for autocad 2002... and can be a better choice... I will, but right now I have other things on my to-do list first.

Have fun,
Luis.

deegeecees

  • Guest
Re: Message Window Pop-up
« Reply #25 on: September 09, 2005, 03:31:17 PM »
Ok, Louis. I'm gonna try and write it VBA. Seems like a fun project, and I could really use something like that.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Message Window Pop-up
« Reply #26 on: September 09, 2005, 03:31:27 PM »
Can you just add this line to the end of the ACADdoc.lsp
Code: [Select]
(POPUP-NOTE)
and remove this
Code: [Select]
;; 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)))))
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 #27 on: September 09, 2005, 03:35:11 PM »
Can you just add this line to the end of the ACADdoc.lsp
Code: [Select]
(POPUP-NOTE)

YES...

Code: [Select]
(defun POPUP-NOTE  ()
  (if (= (vlax-ldata-get "POPUPNOTE" "NOTE") "1")
    (progn
      (vlax-ldata-put "POPUPNOTE" "NOTE" "0")
      (startapp "notepad.exe"
(strcat "\""
(getvar "dwgprefix")
(vl-filename-base (getvar "dwgname"))
".txt\""))))
  (princ))

deegeecees

  • Guest
Re: Message Window Pop-up
« Reply #28 on: September 09, 2005, 03:41:15 PM »
I was thinking of checking the dwgs' directory for the text file, and if exists, open the file, if not do nothing. A much cleaner approach.

Artisan

  • Guest
Re: Message Window Pop-up
« Reply #29 on: September 09, 2005, 04:27:56 PM »
Ok, I got it to work a couple of times. I open one drawing, did the popup routine, added my notes to the txt file and save it and closed down the file. I opened it to check it and it worked. I went to another drawing and tried it again and that one did not work. I had to type in the popup command to pull my notes up on that drawing. So, it works on some drawings, but not all of them. I must be missing something here.