OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: CouchPotato on October 06, 2011, 08:13:57 AM

Title: Invalid Autocad Command
Post by: CouchPotato on October 06, 2011, 08:13:57 AM
I have a Lisp routine that uses the Onclicked control.  When I run it I get the message "invlaid autocad command...nil".  I have see n the other posts that say to set the invoke to Asynchronous.  I have done that for all of the DCL entities (form, option list, text box).  I am on Version 6.0.2 of OpenDcl.  Here is the code.  What do I need to change??


Code (autolisp) Select

(defun c:ElevationDescriptions_Form1_TextButton1_OnClicked (/)
(setq SelectDes (dcl_Control_GetCurrentSelection ElevationDescriptions_Form1_OptionList1))
(setq BlkDes (cond ((= Selectdes 0) "FS")
((= Selectdes 1) "FL")
((= Selectdes 2) "TC")
((= Selectdes 3) "FL,HP")
((= Selectdes 4) "LP")
((= Selectdes 5) "HP")
((= Selectdes 6) "FG,GB")
)
  )
  (setq e2 (car (entsel "\nSelect Elevation to change: ")))
  (setq e2 Esel)
  (setq a (entnext (car e2)))
  (setq b (entnext a))
  (command "-attedit" "y" "" "" "" (entnext b) "v" "r" Blkdes "")
)
 
Title: Re: Invalid Autocad Command
Post by: Fred Tomke on October 06, 2011, 08:27:38 AM
Hello, have you changed the event name? Please check if the event name of the event tab matches to the event name in your code.
c:ElevationDescriptions_Form1_TextButton1_OnClicked
Regards, Fred
Title: Re: Invalid Autocad Command
Post by: CouchPotato on October 06, 2011, 10:26:24 AM
Fred, I'm not sure what happened.  I don't think I changed my event tab code, but I recopied it to the routine and all is well.  Another question, can I get 2 columns in an option box?  If so, how?

Thanks for the clue.

dave
Title: Re: Invalid Autocad Command
Post by: Fred Tomke on October 07, 2011, 12:13:16 AM
Hello, do you mean optionlist? No, you can't add another column.
Have a try with a grid :)

Regards, Fred