Author Topic: start command with acaddoc  (Read 2076 times)

0 Members and 1 Guest are viewing this topic.

sybold

  • Newt
  • Posts: 62
start command with acaddoc
« on: January 26, 2012, 02:20:36 PM »
i'm in the progress of converting old vba code to .net, and we have a call in the acaddoc.lsp to run a vba routine. now is my question can i do the same for a .net created command.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: start command with acaddoc
« Reply #1 on: January 26, 2012, 06:16:09 PM »

You could try it by 'netload'ing the .net DLL and running the registered command.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: start command with acaddoc
« Reply #2 on: January 26, 2012, 07:15:12 PM »
Or, write the core function in dotNET and provide separate interface wrapper methods - one for a command-line definition and one for a LISP function call.  That way the same procedure can be called by both command invocation and through LISP.
If you are going to fly by the seat of your pants, expect friction burns.

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

irneb

  • Water Moccasin
  • Posts: 1794
  • ACad R9-2016, Revit Arch 6-2016
Re: start command with acaddoc
« Reply #3 on: January 27, 2012, 12:23:59 AM »
Or, write the core function in dotNET and provide separate interface wrapper methods - one for a command-line definition and one for a LISP function call.  That way the same procedure can be called by both command invocation and through LISP.
Depends what you want to do. Even the DotNet command wrapper allows script and lisp callable commands. It's when you want to obtain information FROM the dotnet function that you'd need a LispFunction wrapper instead and/or as well.

If it's simply a situation of you want to autoload your dotnet and have a command run each time a dwg is opened. For the autoloading the "cleanest" way is through registry: http://through-the-interface.typepad.com/through_the_interface/2006/09/automatic_loadi.html

Unfortunately the only other way to load DotNet DLL's (except through DotNet/ARX programming) is using the NetLoad command. What I'd actually want was a netload function similar to arxload - that way it would be a lot cleaner (no need to add command calls into a startup defun).
Common sense - the curse in disguise. Because if you have it, you have to live with those that don't.