+ Reply to Thread
Results 1 to 2 of 2
  1. #1
    Full Member
    Computer Details
    looseLISPSsinkSHIPS's Computer Details
    Operating System:
    Windows XP Business Edition
    Computer:
    HP
    Motherboard:
    ?
    CPU:
    Intel Core 2 Duo
    RAM:
    ?
    Graphics:
    ?
    Primary Storage:
    ?
    Monitor:
    HP LP2465 (21")
    Using
    AutoCAD 9
    Join Date
    Sep 2009
    Location
    Netherlands
    Posts
    34

    Unhappy why dose VBA not call my lisp command?

    Registered forum members do not see this ad.

    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:

    Code:
    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?

    Code:
    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)...
    Last edited by rkmcswain; 17th Feb 2010 at 02:10 pm. Reason: added CODE tags

  2. #2
    Super Moderator rkmcswain's Avatar
    Computer Details
    rkmcswain's Computer Details
    Operating System:
    Windows 7 Pro x64
    Motherboard:
    Intel DZ77RE-75K
    CPU:
    i7-3770K 3.50GHz
    RAM:
    32GB
    Graphics:
    Nvidia Quadro 2000
    Primary Storage:
    125GB SSD
    Secondary Storage:
    500GB SATA
    Monitor:
    ASUS 27" / ASUS 24"
    Discipline
    Civil
    Using
    Civil 3D 2013
    Join Date
    Sep 2005
    Location
    Houston
    Posts
    3,633

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by looseLISPSsinkSHIPS View Post
    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.

Similar Threads

  1. * (astrix) dose not work in lisp
    By looseLISPSsinkSHIPS in forum AutoLISP, Visual LISP & DCL
    Replies: 11
    Last Post: 17th Feb 2010, 03:27 pm
  2. Latest Dose of AutoCAD 2010 Updates - System Variables Edition
    By HyperPics in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 24th Apr 2009, 11:40 pm
  3. Lisp Call Lisp Problem
    By neekcotrack in forum AutoLISP, Visual LISP & DCL
    Replies: 1
    Last Post: 23rd Aug 2008, 12:56 pm
  4. Can one lisp routine call another??
    By Maradona_10 in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 29th May 2008, 02:20 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts