Author Topic: How do I load VLX and LISP files with VBA?  (Read 6801 times)

0 Members and 1 Guest are viewing this topic.

Matersammichman

  • Guest
How do I load VLX and LISP files with VBA?
« on: June 27, 2006, 01:27:39 PM »
1. What command can I use to load a VLX file with VBA?  :realmad:

2. What command can I use to load  a LISP file?  :pissed:
« Last Edit: June 27, 2006, 08:42:52 PM by nivuahc »

Bob Wahr

  • Guest
Re: How???
« Reply #1 on: June 27, 2006, 01:37:30 PM »
You could use sendcommand

Matersammichman

  • Guest
Re: How???
« Reply #2 on: June 27, 2006, 01:46:33 PM »
True, but if I can load ARX and DVB with VBA, why not Lisp and Visual Lisp?

Bob Wahr

  • Guest
Re: How???
« Reply #3 on: June 27, 2006, 01:55:04 PM »
Because AutoCAD VBA doesn't have a built in LoadLSP method.  Of course, you can load Lisp and Visual Lisp, just maybe not the way you want to.  There's a better than even chance that referencing a library will allow you to achieve your desired results but if so, someone else will have to chime in on it.

Matersammichman

  • Guest
Re: How???
« Reply #4 on: June 27, 2006, 02:23:17 PM »
Bob,
I'm having a bad brain day...could you drop me a complete line of example code to modify?

Bob Wahr

  • Guest
Re: How???
« Reply #5 on: June 27, 2006, 02:28:10 PM »
thisdrawing.sendcommand "(load ""lispname.lsp"")" & vbcr

ought to work

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How???
« Reply #6 on: June 27, 2006, 02:39:05 PM »
ThisDrawing.SendCommand "(load ""lispname.lsp"" 'doh)" & vbCr
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Bob Wahr

  • Guest
Re: How???
« Reply #7 on: June 27, 2006, 02:42:28 PM »
'doh?

Maverick®

  • Seagull
  • Posts: 14778
Re: How???
« Reply #8 on: June 27, 2006, 02:43:52 PM »
Re, Me, Fa, So, La, Ti, Do   

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How???
« Reply #9 on: June 27, 2006, 02:48:25 PM »
Sure.

ThisDrawing.SendCommand "(load ""lispname.lsp"" 'crapweasel)" & vbCr

ThisDrawing.SendCommand "(load ""lispname.lsp"" (alert ""Load knackered.""))" & vbCr

yada ...


But generally speaking I wouldn't use --

ThisDrawing.SendCommand "(load ""lispname.lsp"")" & vbCr
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Bob Wahr

  • Guest
Re: How???
« Reply #10 on: June 27, 2006, 02:52:33 PM »
OK, he asked a question that no one else was answering, I gave him an answer that works.  If you don't like it, instead of knocking it why don't you dazzle us with your fucking brilliance and show him a better way.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How???
« Reply #11 on: June 27, 2006, 02:56:50 PM »
OK, he asked a question that no one else was answering, I gave him an answer that works.  If you don't like it, instead of knocking it why don't you dazzle us with your 42616E6E656400[/b]ing brilliance and show him a better way.

No need to go hexipostal. I was just demonstrating the optional argument you can pass the load statement so it returns something more illuminating or desirable than --

[0.43] (VL-BT)
[1.39] (*ERROR* "LOAD failed: \"lispname.lsp\"")
[2.34] (_call-err-hook #<SUBR @0312b078 *ERROR*> "LOAD failed:
\"lispname.lsp\"")
[3.28] (sys-error "LOAD failed: \"lispname.lsp\"")
:ERROR-BREAK.23 nil
[4.20] (LOAD "lispname.lsp")
[5.15] (#<SUBR @03288be0 -rts_top->)
[6.12] (#<SUBR @02a22334 veval-str-body> "(load \"lispname.lsp\")" T #<FILE
internal>)
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:ARQ-SUBR-CALLBACK.3 (nil 0)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Matersammichman

  • Guest
Re: How???
« Reply #12 on: June 27, 2006, 03:05:59 PM »
Bob,

So...If its on a drive other than "C"
say "G",
do I need to path it "G:\..." :ugly:

Bob Wahr

  • Guest
Re: How???
« Reply #13 on: June 27, 2006, 03:07:38 PM »
MP:

Sorry, I misunderstood and it was uncalled for regardless.  Looks like I probably shouldn't be in public today.

MSM:
If the lisp is in your support path you don't need to path it, if it's not you do.

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: How???
« Reply #14 on: June 27, 2006, 03:09:47 PM »
Carry on Bob, bigger things to worry about; all is cool.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst