rcb007 Posted April 16, 2021 Posted April 16, 2021 I have some routines that I have put together and within the routine I see the following at the command line: Unknown command "command_name". Press F1 for help. I did not know if there is a way to prevent that from being seen to the user or not? Thanks! Quote
tombu Posted April 16, 2021 Posted April 16, 2021 Just post one of the simplest routines if you want it fixed. The solution to the rest will probably be the same. 1 Quote
rcb007 Posted April 16, 2021 Author Posted April 16, 2021 I think I found out the error or why its give me this error. I noticed when setting up drawings, that there are no wipeouts, it shows me that error of the unknown command. If that is the case, how would you code it with an if statement? if that is the fix. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Sub Routine (defun LM:SortentsTable ( space / dict result ) (cond ( (not (vl-catch-all-error-p (setq result (vl-catch-all-apply 'vla-item (list (setq dict (vla-GetExtensionDictionary space)) "ACAD_SORTENTS") ) ) ) ) result ) ( (vla-AddObject dict "ACAD_SORTENTS" "AcDbSortentsTable") ) ) ) (vl-load-com) (princ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;Sub Routine (defun c:Wipeout_Back ( / acdoc ) (setq acdoc (vla-get-activedocument (vlax-get-acad-object))) (vlax-for block (vla-get-blocks acdoc) (if (and (eq :vlax-false (vla-get-islayout block)) (eq :vlax-false (vla-get-isxref block)) ) ( (lambda ( / lst ) (vlax-for obj block (if (eq "AcDbWipeout" (vla-get-objectname obj)) (setq lst (cons obj lst)) ) ) (if lst (vla-movetobottom (LM:SortentsTable block) (vlax-make-variant (vlax-safearray-fill (vlax-make-safearray vlax-vbobject (cons 0 (1- (length lst)))) lst ) ) ) ) ) ) ) ) (vla-regen acdoc acallviewports) (SSGET "X" '((0 . "WIPEOUT"))) (command "draworder" "p" "" "b") (SSGET "X" '((0 . "LWPOLYLINE") (8 . "C-ANNO-VPORT"))) (command "draworder" "p" "" "b") (princ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:SetUp () (command "-layer" "set" "0" "") (command "zoom" "extents") (command "_.regenall") (command "-layout" "" "") (command "-layout" "Rename" "" "4.0") (command "_move" (ssget "_x" '((0 . "INSERT")(2 . "*legend*"))) "" "0,0" "23.1,21.0451") (command "_.regenall") (C:Wipeout_Back) (command "-layer" "set" "C-ANNO-VPORT" "") (command "_mview" "1.7,23.5719" "22.70,0.2006") (command "_mspace") (command "zoom" "extents") (command "_pspace") (princ)) Quote
tombu Posted April 16, 2021 Posted April 16, 2021 Instead of (command "_move" (ssget "_x" '((0 . "INSERT")(2 . "*legend*"))) "" "0,0" "23.1,21.0451") create the selection set first then test sslength > 0 before using a command on it. 1 Quote
Recommended Posts
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.