Page 1 of 3 123 LastLast
Results 1 to 10 of 23

Thread: Double "Unknown command" After Routine

  1. #1
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Double "Unknown command" After Routine

    I've got this routine, and it runs fine, but after it executes, I get "Unknown command "IBN"" twice. I can't figure out why it's doing that. Can someone take a look and let me know what they think?

    Code:
    (defun c:insertbundlenumber (/ ss j mode)
    
    (COMMAND "-INSERT" "f:/apps/CCS_CAD/LABEL/1TEN_L" "S" "96" PAUSE PAUSE)
    
    (COMMAND "EXPLODE" "L" "")
    
    (COMMAND "CHPROP" "L" "P" "" "LA" (getvar "clayer") "" "")
    
        (progn
         (setq ss (ssadd))
         (ssadd (entlast) ss)
         (setq mode 0)
         (setvar "highlight" 0)
         (setq j (bns_trot ss mode))
        );progn
         (setvar "highlight" 1)
    
    (princ);exit quietly
    
    );defun
    
    ;;; SHORTCUT
    
    (DEFUN C:IBN () (C:insertbundlenumber))
    Thanks you all,

  2. #2
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    Quote Originally Posted by stusic View Post
    I've got this routine, and it runs fine, but after it executes, I get "Unknown command "IBN"" twice. I can't figure out why it's doing that. Can someone take a look and let me know what they think?

    Code:
    (defun c:insertbundlenumber (/ ss j mode)
    
    (COMMAND "-INSERT" "f:/apps/CCS_CAD/LABEL/1TEN_L" "S" "96" PAUSE PAUSE)
    
    (COMMAND "EXPLODE" "L" "")
    
    (COMMAND "CHPROP" "L" "P" "" "LA" (getvar "clayer") "" "")
    
        (progn
         (setq ss (ssadd))
         (ssadd (entlast) ss)
         (setq mode 0)
         (setvar "highlight" 0)
         (setq j (bns_trot ss mode))
        );progn
         (setvar "highlight" 1)
    
    (princ);exit quietly
    
    );defun
    
    ;;; SHORTCUT
    
    (DEFUN C:IBN () (C:insertbundlenumber))
    Thanks you all,
    Why don't you just make your shortcut the command?
    If you can't, did you try adding (princ) after it?

  3. #3
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    I don't think the shortcut's the problem, as I've tried "insertbundlenumber" and it still gives me the error: "Unknown command "insertbundlenumber"" twice. Lemme comment it out and see what it does...

  4. #4
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    Quote Originally Posted by stusic View Post
    I don't think the shortcut's the problem, as I've tried "insertbundlenumber" and it still gives me the error: "Unknown command "insertbundlenumber"" twice. Lemme comment it out and see what it does...
    Hemm, I don't know. I couldn't test your routine, but just for giggles I added a similar shortcut to one of my routines, and it worked fine with no "unknown command".

    Sorry, I don't have an answer. I have seen that before (unknown command) but I don't know what caused it. I think it must be within the main routine.


  5. #5
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    Yep, still gives the error...

    Any other ideas? I'm stumped -- there's only so much code...

  6. #6
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    Okay, the trimmed code:

    Code:
    (defun c:insertbundlenumber (/ ss j mode)
    
    (COMMAND "-INSERT" "f:/apps/CCS_CAD/LABEL/1TEN_L" "S" "96" PAUSE PAUSE)
    
    (COMMAND "EXPLODE" "L" "")
    
    (COMMAND "CHPROP" "L" "P" "" "LA" (getvar "clayer") "" "")
    
        (progn
         (setq ss (ssadd))
         (ssadd (entlast) ss)
         (setq mode 0)
         (setvar "highlight" 0)
         (setq j (bns_trot ss mode))
        );progn
         (setvar "highlight" 1)
    
    (princ);exit quietly
    
    );defun

  7. #7
    Certifiable AUGI Addict tedg's Avatar
    Join Date
    2005-06
    Location
    in the upper right corner
    Posts
    3,507
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    I tried running your routine with a drawing I created.
    Code:
    (defun c:IBN (/ ss j mode)
    
    (COMMAND "-INSERT" "c:/lumber" "S" "96" PAUSE PAUSE)
    
    (COMMAND "EXPLODE" "L" "")
    
    (COMMAND "CHPROP" "L" "P" "" "LA" (getvar "clayer") "" "")
    
        (progn
        (setq ss (ssadd))
        (ssadd (entlast) ss)
        (setq mode 0)
        (setvar "highlight" 0)
        (setq j (bns_trot ss mode))
         );progn
         (setvar "highlight" 1)
    (princ);exit quietly
    );defun
    What version of AutoCAD are you using?

    It returned: "Command: no function definition: BNS_TROT"

    Also I get:
    Unknown command "LA". Press F1 for help.
    Unknown command "0". Press F1 for help.
    Unknown command "IBN". Press F1 for help.
    Unknown command "IBN". Press F1 for help.

    It did, however insert the drawing, what are you trying to achieve with this routine?

  8. #8
    Design Visualization Moderator stusic's Avatar
    Join Date
    2004-10
    Location
    Denver, Colorado
    Posts
    1,515
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    I'm using 2000, so that may be why you aren't getting the BNS_TROT, but LA should work (it's LAYER, after all).

    I'm trying to insert this block, then rotate the text in it to horizontal, no matter what the rotation of the block is. It's a stripped-down version of the express tool's "TORIENT" lisp

  9. #9
    I could stop if I wanted to
    Join Date
    2007-05
    Location
    Brookfield WI
    Posts
    331
    Login to Give a bone
    0

    Default Re: Double "Unknown command" After Routine

    Quote Originally Posted by stusic View Post
    I'm using 2000, so that may be why you aren't getting the BNS_TROT, but LA should work (it's LAYER, after all).

    I'm trying to insert this block, then rotate the text in it to horizontal, no matter what the rotation of the block is. It's a stripped-down version of the express tool's "TORIENT" lisp
    I can't solve your main issue but if add the * it will explode the block after it is inserted

    Code:
    (COMMAND "-INSERT" "*c:/lumber" "S" "96" PAUSE PAUSE)
    then you can remove this line

    Code:
    (COMMAND "EXPLODE" "L" "")

  10. #10
    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: Double "Unknown command" After Routine

    Quote Originally Posted by stusic View Post
    I've got this routine, and it runs fine, but after it executes, I get "Unknown command "IBN"" twice. I can't figure out why it's doing that. Can someone take a look and let me know what they think?

    Code:
    (defun c:insertbundlenumber (/ ss j mode)
    
    (COMMAND "-INSERT" "f:/apps/CCS_CAD/LABEL/1TEN_L" "S" "96" PAUSE PAUSE)
    
    (COMMAND "EXPLODE" "L" "")
    
    (COMMAND "CHPROP" "L" "P" "" "LA" (getvar "clayer") "" "")
    
        (progn
         (setq ss (ssadd))
         (ssadd (entlast) ss)
         (setq mode 0)
         (setvar "highlight" 0)
         (setq j (bns_trot ss mode))
        );progn
         (setvar "highlight" 1)
    
    (princ);exit quietly
    
    );defun
    
    ;;; SHORTCUT
    
    (DEFUN C:IBN () (C:insertbundlenumber))
    Thanks you all,
    what's the progn for? you only need to use it for an if statement

Page 1 of 3 123 LastLast

Similar Threads

  1. 2015: Command: _RBCS_prjpref Unknown command "RBCS_PRJPREF".
    By mankie1 in forum AutoCAD Structural Detailing
    Replies: 0
    Last Post: 2014-11-14, 03:32 PM
  2. AUTOCAD 2013 Error: _sheetset unknown command "sheet set"
    By omorah in forum AutoCAD Customization
    Replies: 3
    Last Post: 2012-06-18, 09:25 PM
  3. AutoCAD Mechanical 2007 - Unknown command "CUI"
    By svanderputten in forum AutoCAD Mechanical - General
    Replies: 3
    Last Post: 2007-01-16, 05:01 AM
  4. When using the Shortcut menu - Unknown command "AI_DIM_TEXTHOME"
    By Shane.Miller in forum AutoCAD General
    Replies: 5
    Last Post: 2006-12-09, 08:17 PM
  5. Replies: 4
    Last Post: 2006-02-03, 07:34 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
  •