create Windows Forms Application, name it "LoadLisp" or something else,
drop Button1 on form and add caption on the button, say "Load my lisp" add references to:
AutoCAD xxxx Type Library
AutoCAD ObjectDBX/Common xx.x Type Library
Add following code on form module, click Build solution
Then go to folder ///...bin/Debug select application and load
its icon on windows screen, then try it
(change lisp file name in command within the code before)
'______________________________________'
Imports System.Reflection
Imports Autodesk.AutoCAD.Interop
Imports Autodesk.AutoCAD.Interop.Common
Public Class Form1
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
Me.Hide()
LoadLisp()
Me.Show()
End Sub
Public Sub LoadLisp()
Dim appver As Object = TryCast(My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Autodesk\AutoCAD", "CurVer", Nothing), Object)
If appver Is Nothing Then
MessageBox.Show("Out of luck, sorry, you get a problem to read Registry", "Bad for you")
Return
End If
Dim oAcadApp As AcadApplication = New AcadApplication
Try
If oAcadApp Is Nothing Then
oAcadApp = GetObject(, "AutoCAD.Application" + appver.ToString())
End If
Catch ex As System.Exception
MessageBox.Show("Working in opened document only!")
Return
End Try
oAcadApp.Visible = True
oAcadApp.WindowState = AcWindowState.acMax
Dim oAcDoc = oAcadApp.ActiveDocument
'' lisp with command C:SPLASH is loaded from disk C:\Test\Splash.lsp
''------------------------------------------------------''
'' Change both lines of next code block to suit:
Dim command As String = "(load ""C:/Test/Splash.lsp"")"
oAcDoc.SendCommand(command & "(C:SPLASH) ")
''------------------------------------------------------''
End Sub
End Class
''___________________________________________________''
I can't help you other then that, coz I have very limited
skills with work from forms
~'J'~
_____________________________________
C6309D9E0751D165D0934D0621DFF27919