Author Topic: Vanilla load  (Read 4280 times)

0 Members and 1 Guest are viewing this topic.

Matersammichman

  • Guest
Vanilla load
« on: May 23, 2006, 05:32:04 PM »
When you open CAD, ACADProject(Global1) is opened.
I'd like to have CAD load a dvb on startup, so I'm thinking I may want to edit "whatever" brings this up.
Suggestions? :pissed:

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #1 on: May 23, 2006, 05:38:19 PM »
well, that is an interesting question b/c there are a number of things you could edit to load dvb files.  What are you familiar with editing?  You could create a LISP file that loads DVB files, or put them in your Startup Suite (I wouldn't, but you could). 
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

Bob Wahr

  • Guest
Re: Vanilla load
« Reply #2 on: May 23, 2006, 05:58:06 PM »
(I wouldn't, but you could).
I disagree with Mr. Duh on that one.  If you want them loaded at startup, especially if they're going to be running in the background, I see no reason at all not to put them in the startup suite.  You can also use an ACAD.DVB as an automatically loaded loader.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #3 on: May 23, 2006, 06:07:25 PM »
I dont use the suite b/c sometimes it freaks out and doesn't load things.  I do use it for some things, but I use the MNL file to load our routines.  I also have a loader function in LISP that checks for the function and loads the dvb if necessary when you call the routine
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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Vanilla load
« Reply #4 on: May 23, 2006, 06:13:55 PM »
....  but I use the MNL file to load our routines. I also have a loader function in LISP that checks for the function and loads the dvb if necessary when you call the routine

yep ... that way the Partial menu controls what is loaded via the MNL .. works for me.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

--> Donate to theSwamp<--

Bob Wahr

  • Guest
Re: Vanilla load
« Reply #5 on: May 23, 2006, 06:16:15 PM »
Agree that there's no reason to load them until needed and the loader lisp is great for that, I have two VBA programs that run in the background constantly.  I've never had a problem with the startup suite freaking or at least have never noticed it.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #6 on: May 23, 2006, 06:20:51 PM »
me either, but I have seen complaints in threads here. (I cant think of where I saw it, just making note of it)
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

Jürg Menzi

  • Swamp Rat
  • Posts: 597
  • Oberegg, Switzerland
Re: Vanilla load
« Reply #7 on: May 24, 2006, 02:39:39 AM »
There is normally no need to preload a VBA module...

In a menu macro type:
-VBARUN;MyApp.dvb!MacroFunctions.MyFunction
The MyApp.dvb file is loaded and the macro is executed. The MyApp.dvb file remains loaded once the macro has been completed.
The dvb module must be in a path of the AutoCAD environment, else you've to specify the full path in the call.
A computer's human touch is its unscrupulousness!
MENZI ENGINEERING GmbH
Current A2k14... A2k18 - Start R2.18

Glenn R

  • Water Moccasin
  • Posts: 1932
  • What idiot child of married cousins wrote this?!
Re: Vanilla load
« Reply #8 on: May 24, 2006, 06:32:12 AM »
It all depends on WHEN you want the startup code to be run.

Adding it into the startup suite/mnl etc. is almost in the last stages of the Acad load process and you will also take the hit of the acadvba/acvba.arx loading at that time.

The absolute best way is to toss an "acad.rx" file into your search path and in that put a line "acadvba.arx" or "acvba.arx" - depends on the version of acad you're running.
This makes sure the VBA interpreter arx is loaded with all the other startup arx files.

You then put an "Acad.dvb" file in the search path - this is vba's equivalent of acad.lsp...it will autoload. If you then want something to execute at startup from Acad.dvb, put a public sub called AcadStartup into a public module and any code in that will be executed when acad starts.

This method will make sure you stuff runs BEFORE any associated lisp/startup suite stuff...all depends on what you want (read - this is the way I ALWAYS do it).

Cheers,
Glenn.
Me

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #9 on: May 24, 2006, 12:21:34 PM »
Thats what I do  ^    .  And it works really well
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

Matersammichman

  • Guest
Re: Vanilla load
« Reply #10 on: June 15, 2006, 12:35:37 PM »
"Why" I want to do this...
I have to take a dvb file and place it on every computer in the workplace.
Our CAD systems are pathed to one global folder for "common" files.
If I can hardcode something that loads from a globally accessed common file on every computer, it will prevent me from having to go to every workstation and add the dvb file into the Startup Suite.
Comments? :lol:

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #11 on: June 15, 2006, 12:46:45 PM »
I would make it acad.dvb, put it in that folder, and it will load from every machine
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

Bob Wahr

  • Guest
Re: Vanilla load
« Reply #12 on: June 15, 2006, 12:49:31 PM »
One word of caution on shared DVBs.  A DVB, unlike a LSP, when loaded is locked.  Everyone can use it at the same time but it cannot be modified, replaced, etc. until it is closed on all machines.  Depending on how many seats you have it could be a hassle.

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #13 on: June 15, 2006, 03:48:59 PM »
I agree 100% with Bob, as I deal with this all the time.  I keep a separate set of dvb files for editing, and have an update routine that copies them to the server at night when noone is using the network versions
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

Bryco

  • Water Moccasin
  • Posts: 1850
Re: Vanilla load
« Reply #14 on: June 16, 2006, 12:00:53 AM »
I also read you can't run more than 20 cads using the same vba due to a bug. Ouch.

havano

  • Guest
Re: Vanilla load
« Reply #15 on: June 18, 2006, 06:47:52 PM »
Maybe you can overcome that by placing multiple instances of the same macro in the common folder, using different file names. If an error occurs due to more than 20 users, you could trap the error and present the 21st-etc. user the/an other instance.

Bob Wahr

  • Guest
Re: Vanilla load
« Reply #16 on: June 19, 2006, 11:45:58 AM »
My preference is still to copy them locally.

Bryco

  • Water Moccasin
  • Posts: 1850
Re: Vanilla load
« Reply #17 on: June 19, 2006, 03:51:08 PM »
Is that automated Bob or one at a time.

havano

  • Guest
Re: Vanilla load
« Reply #18 on: June 20, 2006, 09:57:00 AM »
...you could write a small executable that is run on workstation startup, copies ererything it finds in a certain central network folder to a certain local folder (and ruthlessly overwrites if necessairy) so the newest versions of your macro's are always available locally. Not very elegant maybe, but effective.

Bob Wahr

  • Guest
Re: Vanilla load
« Reply #19 on: June 20, 2006, 10:37:01 AM »
Batch file, even more better/easier than an executable.

Bryco, automated is the way to go as a general rule IMO.  That being said, at this time, in this place, I have a small number of people to support and not a very high frequency of changes so I haven't set up an automated system.

havano

  • Guest
Re: Vanilla load
« Reply #20 on: June 20, 2006, 03:04:37 PM »
Who remembers the DOS commands nowadays...?

OK, start a new txt file and paste this code in it, with appropriate source and target drives\directories.
Rename the saved txt file to e.g. COPY-DVB.BAT (indeed a batch file)
Install COPY-DVB.BAT on all Acad workstations, create a shortcut to it and drop this shortcut in their START menu, under PROGRAMS - STARTUP. In the shortcut properties, you can even specify that you want the BAT file to run in a minimized DOS window.

Code: [Select]
@ECHO OFF
REM this means the commands will not be echoed on screen

COPY /Y /B YourSourcePath\*.DVB YourTargetPath

REM that's all...
REM /Y means no confirmation dialogs (silent mode)
REM /B means you want to copy binary (not ASCII) files
REM If you want to copy other types of files, you can
REM repeat COPY likewise, with other file extensions.
REM COPY *.* (all wildcards) doesn't work in silent mode

My DOS knowledge has also become a bit rusty, but I think this should work.
(Of course, you can also put COPY-DVB.BAT in a central network drive\directory and let the local shortcut in START-PROGRAMS-STARTUP point to that.)
« Last Edit: June 20, 2006, 03:45:33 PM by havano »

CmdrDuh

  • Automatic Duh Generator
  • King Gator
  • Posts: 4039
Re: Vanilla load
« Reply #21 on: June 20, 2006, 03:16:46 PM »
good idea.  I like the KISS principle, yet able to update daily w/o causing problems
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