Author Topic: On App Activate Event  (Read 6526 times)

0 Members and 1 Guest are viewing this topic.

Guest

  • Guest
Re: On App Activate Event
« Reply #15 on: October 16, 2007, 03:34:48 PM »
Glad you got it working!


Now get back to work!!

ML

  • Guest
Re: On App Activate Event
« Reply #16 on: October 16, 2007, 03:36:26 PM »

Yeah, yeah!

I see you are using Land Desktop and Civil 3D   :-)


Guest

  • Guest
Re: On App Activate Event
« Reply #17 on: October 16, 2007, 04:12:25 PM »
...and MEP (God help me) and Architecture.

Well, not really using them any more.  I "support" them.  I've graduated from CADD Monkey to CADD Manager/3D Modeler-Man.



I'm also pretty good with Notepad!   :wink:

ML

  • Guest
Re: On App Activate Event
« Reply #18 on: October 16, 2007, 05:54:23 PM »

Yep

I hear you; I do support, development and help develop CAD Standards.
I have certainly done my share of CAD

I must admit, I sometimes miss some of The Design work I have done in the past but I'm not sure I want to be a manager.

Land Desktop and Civil Design in general is new to me
While I help The CAD/It Manager develop routines and standards, I still have a lot to learn about Land Desktop and Civil Design.

Hopefully I can get in on occasion and do some design work as well.

Mark





ML

  • Guest
Re: On App Activate Event
« Reply #19 on: October 17, 2007, 10:43:02 AM »

Matt
I just thought I would share this with you:

My WsCurrent Module gets fired up on startup, so when I fired up Land Desktop this morning,
I was gettign an error, System Variable can not be set.
It was overlooking The Main (Menufile) cui Land and going to Workspace Map Classic which obviosuly does not exist in the land cui file.

After playing around a bit, I realized that the code was looking for the whole path to the main cui file Land.
That sort of suprises me as we have a path to the main cui and I would think that would have been picked up.
Anyhow, after putting in the path, it did resolve it.

The code is below:

Mark


Code: [Select]
Sub WsCurrent()

Dim Username As Variant
Dim Preferences As AcadPreferences
Dim CurrMenuPath As String
Dim CurrMenuFile As String

Set WshNetwork = CreateObject("WScript.Network")
Set Preferences = ThisDrawing.Application.Preferences

Username = WshNetwork.Username
CurrMenuPath = "C:\Documents and Settings\" & Username & "\Application Data\Autodesk\Autodesk Land Desktop 2006\R16.2\enu\Support\"
CurrMenuFile = Preferences.Files.MenuFile

Select Case CurrMenuFile
 Case Is = CurrMenuPath & "land"
  ThisDrawing.SetVariable "wscurrent", "Land Destop Complete"
 Case Else
  ThisDrawing.SetVariable "wscurrent", "Map Classic"
End Select


End Sub

Guest

  • Guest
Re: On App Activate Event
« Reply #20 on: October 17, 2007, 10:46:43 AM »
Cool!

ML

  • Guest
Re: On App Activate Event
« Reply #21 on: October 17, 2007, 11:02:10 AM »

Yes sir!

Now, the explanation as to why I got into this whole thing LOL
Yes, it is easy enough to manually set what workspace you want current, however I noticed that when I switched workspaces, with some of them that I set up, the toolbars would be all wacked out and not like I had set them.

So, after reading about it; the article said that when you setup the toolbars in your workspace, those changes get written to the registry however, once ACAD is closed, the changes are not saved in the registry.

I can not explain why I did not have that problem in Land Desktop but I did with Map General.
So, the article suggested using a startup routine to set current in CAD what workspace you want current on startup and your workspace changes will be retained.

It doesn't necessarily make sense but I am not surprised as these cui files have many flaws.

So, now I will set up my Map Classic Workspace precise how I want it and see if the changes do get maintained.

Mark


ML

  • Guest
Re: On App Activate Event
« Reply #22 on: October 17, 2007, 11:12:53 AM »

Well, htat did not fix the problem; I guess I will need to read more on workspaces when I have time.

Still the code can be useful for other purposes I'm sure :)

Mark

ML

  • Guest
Re: On App Activate Event
« Reply #23 on: October 17, 2007, 03:04:53 PM »

Man oh Man

It gets even deeper now.
I didn't think about the profiles.

For example, if Land Desktop is already open, then the starup routine in The Acad.dvb file is saying, OK
Land is the (menufile) main cui.

Now, if I open Map Enabled, the macro (from the same acad.dvb file) is started again and I believe it is seeing Land as the main cui from Land Desktop and telling me that the system variable can not be set.

On top of that, if royally F'd up my MapGeneral profile,  :pissed:
So, luckily I had that backed up and restored it.

So, this is interesteing, I have 2 Versions of ACAD sharing the same acad.dvb file.
So, what I think I will need to do is first,
Check for profile:

If profile = LandDesktop then
 The rest of my code
Else
 The rest of my code
End if

Mark

Guest

  • Guest
Re: On App Activate Event
« Reply #24 on: October 17, 2007, 03:10:45 PM »
 :lmao:

Better you than me!  (are you sure manually setting the workspace isn't a better option at this point?)

ML

  • Guest
Re: On App Activate Event
« Reply #25 on: October 17, 2007, 03:15:25 PM »

LOL

Actually, if it doesn't fix the toolbar-workspace problem which it doen't seem to be doing, then yes, I will scrap it.
However, adding the profile part is easy.

If I find the post about workspaces and toolbars not being retained, I will post it.

The good thing is that people are starting LandDesktop with The LandDEsktop profile and MapGeneral with The MapGeneral Profile as they are switches /profile in the startup icon. So, that is pretty fixed.

It still never hurts to have the code written, I am sure I can utilize it later in some other project.

Mark

ML

  • Guest
Re: On App Activate Event
« Reply #26 on: October 18, 2007, 10:46:57 AM »

Matt

Here is that article
Now you will better understand why I am writing this code (time permitting)
However, the article is usuing a LISP startup and I am using THe ACAD acadstartup method.
Still, it doesn't seem to be fixing the problem; then again the problem may be because I am using The Same acad.dvb file for both versions of CAD. Not sure

Mark


http://usa.autodesk.com/adsk/servlet/ps/item?siteID=123112&id=7313141&linkID=9240617

ML

  • Guest
Re: On App Activate Event
« Reply #27 on: October 18, 2007, 10:48:19 AM »

And yes, I should be using spell check :)

BTW: If you were once a CAD Monkey; does that now make you a zoo keeper :)

Mark

Guest

  • Guest
Re: On App Activate Event
« Reply #28 on: October 18, 2007, 10:51:37 AM »

And yes, I should be using spell check :)

BTW: If you were once a CAD Monkey; does that now make you a zoo keeper :)

Mark

Some days it feels more like a babysitter.  :wink:

ML

  • Guest
Re: On App Activate Event
« Reply #29 on: October 18, 2007, 10:54:55 AM »

In this case; better you then me LOL
I think I'd rather be stuck on code :)

However, I can say been there, F-that! LOL