+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Jun 2016
    Posts
    18

    Default run lisp routine error unknown command

    Registered forum members do not see this ad.

    Hello Guys,

    I have an lisp program that search text entity and extract data. however my program come up with an error "unknown command". Please help..

    TIA,

    Dax
    Attached Files

  2. #2
    Luminous Being
    Using
    Civil 3D 2016
    Join Date
    Dec 2005
    Location
    GEELONG AUSTRALIA
    Posts
    8,663

    Default

    more than likey that the directory does not exist VLIDE gave up here

    Code:
    (setq file (open "C:\\aut13\\extractedpsvdata.csv" "a"))
        (write-line (strcat filename "," tagNo "," press "," size) file)
              (close file)
    A man who never made mistakes never made anything

  3. #3
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Jun 2016
    Posts
    18

    Default

    Quote Originally Posted by BIGAL View Post
    more than likey that the directory does not exist VLIDE gave up here

    Code:
    (setq file (open "C:\\aut13\\extractedpsvdata.csv" "a"))
        (write-line (strcat filename "," tagNo "," press "," size) file)
              (close file)
    Hi BIGAL,

    Thank you for your response. The directory exist, thought my lisp routine was working, but when I executed this to multiple drawings (using script file), it does not moved to the another drawings. I've also notice the "unknown command extractentity (which is in my program), but when I added (command "") or just pressing "enter command" on my program it just executed. I think this error causing the problem that why it did not moved to the another drawings.

  4. #4
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Jun 2016
    Posts
    18

    Default

    Hi Guys,

    Anyone here who could help resolve the error..

    Thanks,

    Dax

  5. #5
    Senior Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    304

    Default

    Maybe you will get more answers if you post a test drawing.
    Exactly explaining what the program should do may also help (why the temporary circle?).
    BricsCAD 16

  6. #6
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Jun 2016
    Posts
    18

    Default

    Quote Originally Posted by Roy_043 View Post
    Maybe you will get more answers if you post a test drawing.
    Exactly explaining what the program should do may also help (why the temporary circle?).
    Hi Roy,

    Thanks for your response, there something wrong with my code when executing the lisp program thru .scr file, it gives me a unknown command "wp" which is reside on my lisp. But when this executed manually it just executed cleanly.

    (inside .scr file)

    .OPEN
    "drawing name"
    ZOOM
    A
    (C:EXTRACTPSVDATA)

    this working perfectly when entering manually..

    Regards,

    Dax

  7. #7
    Senior Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    304

    Default

    OK that is very useful information.

    The problem is caused by the CMDACTIVE variable. It is not zero when a script is running (see the documentation).

    Instead of:
    Code:
    (if (zerop (getvar 'cmdactive))
      ...
    )
    Use:
    Code:
    (if (zerop (logand (getvar 'cmdactive) 3))
      ...
    )
    BricsCAD 16

  8. #8
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Jun 2016
    Posts
    18

    Default

    Quote Originally Posted by Roy_043 View Post
    OK that is very useful information.

    The problem is caused by the CMDACTIVE variable. It is not zero when a script is running (see the documentation).

    Instead of:
    Code:
    (if (zerop (getvar 'cmdactive))
      ...
    )
    Use:
    Code:
    (if (zerop (logand (getvar 'cmdactive) 3))
      ...
    )
    Hi Roy,

    After changing the code, its works perfectly... Thanks much!! have your tried to load this kind of lisp to multiple drawings without using third party tools like script pro.. etc.
    Just wondering this is possible :

    - run batch program (open autocad and run .scr file)
    - .scr file will execute .lsp file to create another .scr file that contain list of drawings.
    Sample.
    .OPEN
    "drawing name1"
    (load "lisp program")
    lisp program
    .CLOSE
    Y
    .OPEN
    "drawing name2"
    (load "lisp program")
    lisp program
    .CLOSE
    Y


    Regards,

    Dax

  9. #9
    Senior Member
    Using
    not applicable
    Join Date
    Jun 2016
    Posts
    304

    Default

    Quote Originally Posted by dax View Post
    Just wondering this is possible :

    - run batch program (open autocad and run .scr file)
    - .scr file will execute .lsp file to create another .scr file that contain list of
    Probably. But I must say I do not understand the logic behind this approach.
    BricsCAD 16

  10. #10
    Junior Member
    Using
    AutoCAD 2014
    Join Date
    Jun 2016
    Posts
    18

    Default

    Registered forum members do not see this ad.

    Quote Originally Posted by Roy_043 View Post
    Probably. But I must say I do not understand the logic behind this approach.
    This is a automation to extract data/attribute from a specific entity, initially I do this with batch program, but prob with this approach is that it open and close autocad instance per drawing, thats why I change it to iterate thru a .scr file. Im planning to have a UI on this on Excel format and the output will be also on Excel. The user for this been able to input text value and directory of the drawings.

    Regards,

    Dax

Similar Threads

  1. ;error: Unknown function definition when it is clearly in my lisp.
    By Lee Chu Chu in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 21st Jul 2014, 11:32 pm
  2. LISP - Unknown command for lot of well known LISPs - Solved
    By p0peye in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 8th Nov 2013, 11:38 am
  3. "chamfer" unknown command in lisp routine
    By cso in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 28th Apr 2011, 06:49 pm
  4. Open and Save command causes "Unknown Command" error
    By andythoms in forum AutoCAD General
    Replies: 5
    Last Post: 12th Nov 2010, 05:00 pm
  5. Error: Unknown command when using the APPLOAD
    By Autodesk in forum AutoCAD RSS Feeds
    Replies: 0
    Last Post: 16th Nov 2006, 06:21 pm

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