Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: unknown command

  1. #1
    Member
    Join Date
    2010-02
    Posts
    7
    Login to Give a bone
    0

    Default unknown command

    Why is autocad saying -blockreplace is and unknow command??

    (DEFUN C2e (/)
    (setvar "cmdecho" 1)
    (command "-BLOCKREPLACE" "cd-relay" "cde-relay" "y")
    (PRIN1))

    Command: P2e
    -BLOCKREPLACE Unknown command "-BLOCKREPLACE". Press F1 for help.

    Command: cd-relay Unknown command "CD-RELAY". Press F1 for help.

    Command: cde-relay Unknown command "CDE-RELAY". Press F1 for help.

    Command: y Unknown command "Y". Press F1 for help.

    Command:

  2. #2
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: unknown command

    Welcome to AUGI!

    BlockReplace is an Express Tools Command... If you're getting an unknown command error, simply add the ..\Express\ folder (in your installation path) to your Support Files Search Path (SFSP), and ensure that the AcetMain.Cuix is loaded as Partial CUIx.

    HTH
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  3. #3
    Member
    Join Date
    2010-02
    Posts
    7
    Login to Give a bone
    0

    Default Re: unknown command

    The Express folder path is in my support files search path and the acetmain.cuix is loaded. The command (-blockreplace) works if I type it in at the command prompt, just not as a lisp!!

  4. #4
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: unknown command

    Quote Originally Posted by traci.242201 View Post
    The Express folder path is in my support files search path and the acetmain.cuix is loaded. The command (-blockreplace) works if I type it in at the command prompt, just not as a lisp!!
    If you want to call an Express tools' command calls directly from a lisp routine , you should call it like this (c:ReplaceBlock) and I am not sure if you can feed it the same way you are doing .

  5. #5
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: unknown command

    More on the c:-BlockReplace LispFunction:

    Code:
    (startapp "explorer" (findfile "blocktoxref.lsp"))
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

  6. #6
    Certifiable AUGI Addict ccowgill's Avatar
    Join Date
    2004-08
    Location
    Iron Station, NC
    Posts
    3,198
    Login to Give a bone
    0

    Default Re: unknown command

    I dont believe you can enter the prompts for the block replace command. it has something to do with the fact that it doesnt accept arguments, only answers to prompts. If you want to do it that way, you need to hardcode your answers into a copy of the original express tools lsp file, assuming its a lsp, not an arx. I have done it in the past for enclose text in object routine. alternatively you could also set up the program so it takes arguments, but that is a little more involved.

  7. #7
    Member
    Join Date
    2010-02
    Posts
    7
    Login to Give a bone
    0

    Default Re: unknown command

    Thanks for the info. I have tried all the above ideas but with no success. Thanks for the input.

  8. #8
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: unknown command

    Quote Originally Posted by traci.242201 View Post
    Thanks for the info. I have tried all the above ideas but with no success. Thanks for the input.
    Try searching the AutoLISP forum for "BLOCKREPLACE", I found a few threads that may answer your questions. If you post what code you have so far and a good description of what you want the code to do you will generally get the help you need here. Adding what you do and what version and type of AutoCAD software you're using to your signature helps folk know what you need as well.

  9. #9
    Past Vice President / AUGI Volunteer peter's Avatar
    Join Date
    2000-09
    Location
    Honolulu HI
    Posts
    1,106
    Login to Give a bone
    0

    Default Re: unknown command

    You can create a script file

    (since you cannot run the express tools function by re-entering lisp from lisp)

    Call it blockreplace.scr

    Code:
    (c:-blockreplace)
    CD-RELAY
    CDE-RELAY
    Y
    Then you can call that script from lisp

    (command "script" "blockreplace.scr")

    And replace the blocks.

    P-
    AutomateCAD

  10. #10
    Administrator BlackBox's Avatar
    Join Date
    2009-11
    Posts
    5,714
    Login to Give a bone
    0

    Default Re: unknown command

    Quote Originally Posted by peter View Post
    You can create a script file

    (since you cannot run the express tools function by re-entering lisp from lisp)

    Call it blockreplace.scr

    Code:
    (c:-blockreplace)
    CD-RELAY
    CDE-RELAY
    Y
    Then you can call that script from lisp

    (command "script" "blockreplace.scr")

    And replace the blocks.

    P-
    Neat idea Peter... Just look out for errors:

    Code:
    Command: _SCRIPT
    Enter script file name "foo.scr"
    
    Command: (c:-blockreplace)
    
    Initializing...
    Select the block to be replaced or [?/= (select object)]: CD-RELAY
    
    The block 'CD-RELAY' was not found.
    Select the block to be replaced or [?/= (select object)]: CDE-RELAY
    
    The block 'CDE-RELAY' was not found.
    Select the block to be replaced or [?/= (select object)]: Y
    
    The block 'Y' was not found.
    Select the block to be replaced or [?/= (select object)]: *Cancel*
    
    Command:
    Perhaps instead, it would be prudent to have a LISP file call the script (.SCR), only _if_ the predefined blocks exist:

    Code:
    (defun c:MyBlkRep ()
      (if (and (tblsearch "block" "CD-RELAY")
               (tblsearch "block" "CDE-RELAY")
          )
        (command "._script" "<YourFilePath>\\<YourFileName>.scr")
        (prompt "\n** Block not found ** ")
      )
      (princ)
    )
    I would simply store this LISP, and the associated Script in the same location, with the same file names (obviously different extensions).

    HTH
    "How we think determines what we do, and what we do determines what we get."

    Sincpac C3D ~ Autodesk Exchange Apps

    Computer Specs:
    Dell Precision 3660, Core i9-12900K 5.2GHz, 64GB DDR5 RAM, PCIe 4.0 M.2 SSD (RAID 0), 16GB NVIDIA RTX A4000

Page 1 of 2 12 LastLast

Similar Threads

  1. 2007: Publish Command says unknown command in autocad 2007
    By drajappa594109 in forum AutoCAD General
    Replies: 2
    Last Post: 2012-07-13, 03:34 PM
  2. AutoCAD LT 2007 Appload command returns - unknown command
    By tbedrich in forum AutoCAD LT - General
    Replies: 3
    Last Post: 2007-04-10, 02:09 PM
  3. Rectangle command returns - unknown command
    By rhayes.99001 in forum AutoCAD General
    Replies: 5
    Last Post: 2006-11-27, 02:33 PM
  4. _ai_molc command returns unknown command message
    By jan.pennabecker in forum AutoCAD Customization
    Replies: 16
    Last Post: 2006-05-19, 12:02 AM
  5. Replies: 4
    Last Post: 2006-05-09, 08:57 PM

Posting Permissions

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