OpenDCL Forums

OpenDCL => Runtime/AutoLISP => Topic started by: Kerry on November 07, 2013, 01:49:09 AM

Title: Control name as string ??
Post by: Kerry on November 07, 2013, 01:49:09 AM
My old memoty is failing me.
Is there a way to identify a control by a string instead of it's object name.

eg, I thought I could do this ... but it's failing with an 'Error: expected more arguments"
It's been a while since I've used OpenDCL and my grey stuff is slowing down ...

Code (autolisp) Select

  (setq controlList '("Top" "Bottom"    "Front"     "Back"      "Left"
                            "Right"     "isoSW"     "isoSE"     "isoNE"
                            "isoNW"     "isoSWB"    "isoSEB"    "isoNEB"
                            "isoNWB"    "30+30"     "50+30"     "130+30"
                            "150+30"    "200+30"    "230+30"    "310+30"
                            "310+30"    "30-30"     "50-30"     "130-30"
                            "150-30"    "200-30"    "230-30"    "310-30"
                            "330-30"
                           )
  )
  (setq valuesList '())
  ;;-------------------------------------------
  ;;-------------------------------------------
  (defun c:UCSer_Form_TextButton1_OnClicked (/)
    (foreach name controlList
      (if (= 1 (dcl_Control_GetValue (strcat "UCSer_Form_" name)))
          (setq valuesList (cons name valuesList))
      )
    )
    (dcl_Form_Close UCSer_Form)
    ;;  (cond
    ;;    ( ( )     )
    ;;    )
  )


Regards,
Title: Re: Control name as string ??
Post by: Kerry on November 07, 2013, 02:22:49 AM
Sorted !


Code (autolisp) Select


      (if (= 1 (dcl_Control_GetValue "UCSer" "Form"  name))
        (setq valuesList (cons name valuesList))
      )



did the trick.