Jump to content

why dose VBA not call my lisp command?


Guest looseLISPSsinkSHIPS

Recommended Posts

Guest looseLISPSsinkSHIPS

Hi,

 

I have created a lisp named FLAT.lsp and loaded it with in AutoCAD 2010 I then tested it by typing its command in the command prompt with the result being positive.

 

I have now scripted a VBA program that is as follows:

 

Private Sub CommandButton1_Click()
If CheckBox1 Then
ThisDrawing.SendCommand ("(Command ""Flat"")" & vbCr)
End If
Unload UserForm1
End Sub

Private Sub UserForm_Click()

End Sub

 

Even though the lisp is loaded and its command is working if typed manually, auto cad dose not respond to my call for the function, stating the following at the command prompt:

 

Command: (Command "Flat")

Flat Unknown command "FLAT". Press F1 for help.

 

How can this be, its calling the exact same command name as what I would type in manually???

 

Could anybody tell me where my error is I have tried my VBA program with an existing AutoCAD command as follows (which seams to work fine) yet I don’t see the difference?

 

Private Sub CommandButton1_Click()
If CheckBox1 Then
ThisDrawing.SendCommand ("(Command ""LINE"")" & vbCr)
End If
Unload UserForm1
End Sub

Private Sub UserForm_Click()

End Sub

 

Thanks-

 

I belive I had this b4 a few years ago, sothing to do with creating a module in VBA (cant be for sure now)...

Link to comment
Share on other sites

Even though the lisp is loaded and its command is working if typed manually, auto cad dose not respond to my call for the function, stating the following at the command prompt:

 

Command: (Command "Flat")

Flat Unknown command "FLAT". Press F1 for help.

 

How can this be, its calling the exact same command name as what I would type in manually???

 

Because it's not an internally defined command.

Try (c:flat) at the command prompt.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...