Author Topic: Copy DLLs Local  (Read 1761 times)

0 Members and 1 Guest are viewing this topic.

Dale Bartlett

  • Mosquito
  • Posts: 17
Copy DLLs Local
« on: March 23, 2013, 08:14:11 AM »
I have a customisation/management question that seems simple but has me puzzled. I manage 100+ CAD techs and have all customisation located on a central server that all AutoCADs reference via a common profile. As we move more to .Net addins, I want to centralise control and updates. The dlls cannot reside on the server without engaging IT/IS, so I am left with copying dll files to a dedicated local folder (D:\xxx\AutoCAD\Addins). I have a batch program to do that currently, but want to automate it for the first time AutoCAD runs (not each drawing via AcadDoc.lsp). I use AcadDoc.lsp to load the .Net addins (if existing) and to push new updates out generally. We don't use an enterprise cui but do have a partial menu. Perhaps the partial mnl file could work; does it only load once? Any ideas very welcome. Dale

Jeff_M

  • King Gator
  • Posts: 4100
  • C3D user & customizer
Re: Copy DLLs Local
« Reply #1 on: March 23, 2013, 10:18:05 AM »
acad.lsp, as long as the ACADLSPASDOC sysvar is set to 0, only loads once per session.

BlackBox

  • King Gator
  • Posts: 3770
Re: Copy DLLs Local
« Reply #2 on: March 23, 2013, 01:14:07 PM »
In my limited experience, unless you're using Autoloader there's no need to copy your custom assemblies local. Instead simply netload (or have your registry loader load) them from your network location.

Depending on your version of AutoCAD (pre-.NET 4.0, i.e., 2011), you may need to also make a minor modification to Acad.Exe.Config to enable LoadFromRemoteSources element.

If you need to work locally, just use Autoloader.
"How we think determines what we do, and what we do determines what we get."

bargool

  • Guest
Re: Copy DLLs Local
« Reply #3 on: March 27, 2013, 02:11:24 AM »
there's no need to copy your custom assemblies local. Instead simply netload (or have your registry loader load) them from your network location.
There is one problem: updates of dll. While someone using your dll's on the server, you can't update them. So local copying is better in this case.

BlackBox

  • King Gator
  • Posts: 3770
Re: Copy DLLs Local
« Reply #4 on: March 27, 2013, 08:27:52 AM »
there's no need to copy your custom assemblies local. Instead simply netload (or have your registry loader load) them from your network location.
There is one problem: updates of dll. While someone using your dll's on the server, you can't update them. So local copying is better in this case.

While true... That entirely depends on how often one updates a well written plug-in, methinks.  :-)
"How we think determines what we do, and what we do determines what we get."

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Copy DLLs Local
« Reply #5 on: March 27, 2013, 10:30:37 AM »
I recognized a need for this early on (not just with DLLs but data and other local files), so I built a "run once" utility into our LISP startup sequence.  It looks for certain folders and loads the LSP files it finds in them.  As it loads them, it also adds the file to a permanent tracking list so it won't load it again in the future.  For updating DLLs, I have the LSP call a simple DOS-box EXE which reads a centralized XML manifest for which DLL files should be copied where, and which build version should be present.  This way there isn't a boatload of file movement over the network, things only update when I want them to, and if a computer misses a few they get applied the next time AutoCAD is used.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}

Dale Bartlett

  • Mosquito
  • Posts: 17
Re: Copy DLLs Local
« Reply #6 on: March 29, 2013, 06:20:21 AM »
Thanks for the replies, all food for thought. I've gone with the acad.lsp to copy local, then acaddoc.lsp to load if not loaded. So far this simple system is working well. It enables me to send the updated plugin to the server, and they get the new version whenever AutoCAD is restarted. The files are small so there is no traffic issue, and I don't need to engage the users in any way. Lots of ways to skin a cat, but this suits for now. Regards, Dale