Author Topic: How to run a lisp routine automatically when switching workspaces  (Read 2454 times)

0 Members and 1 Guest are viewing this topic.

Cawaugh

  • Guest
How to run a lisp routine automatically when switching workspaces
« on: September 11, 2006, 08:46:46 AM »
 This is driving me nuts!  :realmad: I haven't found a solution to my question and I have looked in many areas with no luck. I'm sure it's so simple that I'm missing it and I'm probably looking in the wrong area anyway. Maybe someone can make my day if there even is a solution to this.  :-D . Thanks for listening to my raving.   :ugly:

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: How to run a lisp routine automatically when switching workspaces
« Reply #1 on: September 11, 2006, 09:01:14 AM »
i didn't see anything in the VBA area of AcadDocument, so maybe its not exposed
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: How to run a lisp routine automatically when switching workspaces
« Reply #2 on: September 11, 2006, 09:18:54 AM »
Reactor stuff here: http://www.theswamp.org/index.php?topic=9736.msg124522#msg124522
I don't do any but you might be looking for this:  vlr-documentBecameCurrent
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.

Tramber

  • Guest
Re: How to run a lisp routine automatically when switching workspaces
« Reply #3 on: September 11, 2006, 11:04:47 AM »
In my opinon, the easiest way would be to attach a reactor that react to the change of a variable. I know it exists.

Then each time the reactor is called, just make it check variables like TILEMODE and the others.

T.Willey

  • Needs a day job
  • Posts: 5251
Re: How to run a lisp routine automatically when switching workspaces
« Reply #4 on: September 11, 2006, 11:50:49 AM »
Here is something he is looking for.
Code: [Select]
(if (not GlbReactorWorkspaceChange)
 (setq GlbReactorWorkspaceChange (vlr-sysvar-reactor "MyWorkspaceReactor" '((:vlr-sysVarChanged . ShowCurrentWorkspace))))
)

(defun ShowCurrentWorkSpace (React SysVar)

(if (and (= (strcase (car SysVar)) "WSCURRENT") (= (cadr SysVar) T))
 (progn
  (prompt (strcat "\n New workspace: " (getvar "wscurrent")))
 )
)
(princ)
)
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.

Tramber

  • Guest
Re: How to run a lisp routine automatically when switching workspaces
« Reply #5 on: September 11, 2006, 01:52:01 PM »
Yes, workspaces and not the CTAB or the TILEMODE variable I was talking about. WSCURRENT is so new to me that I was not able to give it  ;-)



T.Willey

  • Needs a day job
  • Posts: 5251
Re: How to run a lisp routine automatically when switching workspaces
« Reply #6 on: September 11, 2006, 01:53:41 PM »
Yes, workspaces and not the CTAB or the TILEMODE variable I was talking about. WSCURRENT is so new to me that I was not able to give it  ;-)



No problem.  You were on the right path.  :wink:
Tim

I don't want to ' end-up ', I want to ' become '. - Me

Please think about donating if this post helped you.