TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: velasquez on June 17, 2011, 04:15:17 PM

Title: AutoLisp this working?
Post by: velasquez on June 17, 2011, 04:15:17 PM
How to find out if a function AutoLisp this working?
CMDACTIVE does not show it.
Thanks
Title: Re: AutoLisp this working?
Post by: CAB 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)
Title: Re: AutoLisp this working?
Post by: velasquez 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.
Title: Re: AutoLisp this working?
Post by: Lee Mac 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)
)
Title: Re: AutoLisp this working?
Post by: velasquez 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