Author Topic: AutoLisp this working?  (Read 2036 times)

0 Members and 1 Guest are viewing this topic.

velasquez

  • Newt
  • Posts: 176
AutoLisp this working?
« on: June 17, 2011, 04:15:17 PM »
How to find out if a function AutoLisp this working?
CMDACTIVE does not show it.
Thanks

CAB

  • Global Moderator
  • Seagull
  • Posts: 10339
Re: AutoLisp this working?
« Reply #1 on: June 17, 2011, 05:39:31 PM »
From the help file.
Quote
Indicates whether an ordinary command, transparent command, script, or dialog box is active. The setting is stored as a bitcode using the sum of the following values:

1 Ordinary command is active
 
2 Ordinary command and a transparent command are active
 
4 Script is active
 
8 Dialog box is active
 
16 DDE is active
 
32 AutoLISP is active (only visible to an ObjectARX-defined command)
 
64 ObjectARX command is active

Try something like this:
Code: [Select]
(= (logand (getvar "cmdactive") 32) 32)or this
Code: [Select]
(= (logand (getvar "cmdactive") 16) 16)
I've reached the age where the happy hour is a nap. ()
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

velasquez

  • Newt
  • Posts: 176
Re: AutoLisp this working?
« Reply #2 on: June 18, 2011, 08:48:26 AM »
From the help file.
Quote
Indicates whether an ordinary command, transparent command, script, or dialog box is active. The setting is stored as a bitcode using the sum of the following values:

1 Ordinary command is active
 
2 Ordinary command and a transparent command are active
 
4 Script is active
 
8 Dialog box is active
 
16 DDE is active
 
32 AutoLISP is active (only visible to an ObjectARX-defined command)
 
64 ObjectARX command is active

Try something like this:
Code: [Select]
(= (logand (getvar "cmdactive") 32) 32)or this
Code: [Select]
(= (logand (getvar "cmdactive") 16) 16)

Thanks Cab,

The AutoLISP function waits for a response but returns CMDACTIVE is 0.

Lee Mac

  • Seagull
  • Posts: 12225
  • London, England
Re: AutoLisp this working?
« Reply #3 on: June 18, 2011, 08:54:16 AM »
Perhaps?

Code: [Select]
(defun c:test nil
  (if *lisp-reactor*
    (progn (vlr-remove *lisp-reactor*) (setq *lisp-reactor* nil))
    (setq *lisp-reactor* (vlr-lisp-reactor nil '((:vlr-lispwillstart . lispcallback))))
  )
  (princ)
)

(defun lispcallback ( reactor params )
  (princ "\n--> LISP is Running.")
  (princ)
)

velasquez

  • Newt
  • Posts: 176
Re: AutoLisp this working?
« Reply #4 on: June 19, 2011, 10:11:21 AM »
Perhaps?

Code: [Select]
(defun c:test nil
  (if *lisp-reactor*
    (progn (vlr-remove *lisp-reactor*) (setq *lisp-reactor* nil))
    (setq *lisp-reactor* (vlr-lisp-reactor nil '((:vlr-lispwillstart . lispcallback))))
  )
  (princ)
)

(defun lispcallback ( reactor params )
  (princ "\n--> LISP is Running.")
  (princ)
)

Thank you for your code Lee