Author Topic: Why/How does re-restarting a command produce: "Unknown command"?  (Read 1187 times)

0 Members and 1 Guest are viewing this topic.

ScottMC

  • Newt
  • Posts: 194
Please consider:

Code: [Select]
(defun c:ffr (/ *error* asel adata) ;; https://www.theswamp.org/index.php?topic=56774.msg604922#msg604922
  ;;; Kent Cooper, 8 October 2019
        (setvar 'cmdecho 0)
      (defun *error* ( msg )
        (vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
        (if qaf (setvar 'qaflags qaf))
        (if msg (prompt msg))
            (setvar 'cmdecho 1)   
        (princ)
      )
  ; ;;-----------------
  (vla-startundomark
    (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  )

    (command "fillet" "r" (getdist (strcat "\n Radius: "(rtos (getvar 'filletrad) 3 5)"\n Enter/Pick Fillet Radius: " )))

    (princ (strcat "\n ** Radius Now: "(rtos (getvar 'filletrad) 3 5)" **"))
   
 (while                                               ;; fillet loop
           (princ " ") ;; enables loop.. ??????
  (setvar 'cmdecho 1)

 (command "_.fillet" "\\" "\\")
 
 );; end of while
 
 (setvar 'cmdecho 1)
  (*error* nil)
  (princ)
)
  (vl-load-com)
  (princ)


BIGAL

  • Swamp Rat
  • Posts: 1434
  • 40 + years of using Autocad
Re: Why/How does re-restarting a command produce: "Unknown command"?
« Reply #1 on: August 22, 2023, 09:35:08 PM »
Maybe ask Kent he is on the Autodesk forum all the time, yes locked up my Bricscad when ran a second time.
A man who never made a mistake never made anything

ScottMC

  • Newt
  • Posts: 194
Re: Why/How does re-restarting a command produce: "Unknown command"?
« Reply #2 on: August 22, 2023, 09:44:24 PM »
Found Kents working program.. sorry I didn't sooner.

Code: [Select]
(defun c:ffr (/ *error* asel adata) ;; https://www.theswamp.org/index.php?topic=56774.msg604922#msg604922
  ;;; Kent Cooper, 8 October 2019
        (setvar 'cmdecho 0)
      (defun *error* ( msg )
        (vla-endundomark (vla-get-activedocument (vlax-get-acad-object)))
        (if qaf (setvar 'qaflags qaf))
        (if msg (prompt msg))
            (setvar 'cmdecho 1)   
        (princ)
      )
  ; ;;-----------------
  (vla-startundomark
    (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  )

    (command "fillet" "r" (getdist (strcat "\n Radius: "(rtos (getvar 'filletrad) 3 5)"\n Enter/Pick Fillet Radius: " )))

    (princ (strcat "\n ** Radius Now: "(rtos (getvar 'filletrad) 3 5)" **"))
   
 (while                                               ;; fillet loop
           (princ " ") ;; enables loop.. ??????
  (setvar 'cmdecho 1)

 (command "_.fillet" "\\" "\\")
 
 );; end of while
 
 (setvar 'cmdecho 1)
  (*error* nil)
  (princ)
)
  (vl-load-com)
  (princ)