Author Topic: Loading Lisp via VBA  (Read 3150 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Loading Lisp via VBA
« on: April 29, 2014, 01:25:05 PM »
I am having a really hard time trying to get this lisp to load into autocad. Am I missing something?

Code: [Select]
Public AcadApp As AcadApplication

Sub lsp()

 On Error Resume Next
 Set AcadApp = GetObject(, "AutoCAD.Application")
 If Err Then
 Err.Clear
 Set AcadApp = CreateObject("AutoCAD.Application")
 End If

 AppActivate AcadApp.Caption
 AcadApp.Visible = True
 AcadApp.Application.WindowState = acNorm
 AcadDoc.ActiveSpace = acModelSpace


 If AcadApp.Documents.Count = 0 Then
 AcadApp.Documents.Add
 End If


 AcadApp.ActiveDocument.SendCommand "(load ""C:/temp/lsp.lsp"") "
 AcadApp.ActiveDocument.SendCommand "(c:lsp) "


End Sub

Again, thank you for the help.
Civil3D 2020