Control name as string ??

Started by Kerry, November 07, 2013, 01:49:09 AM

Previous topic - Next topic

Kerry

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,
Perfection is not optional.
My other home is TheSwamp

Kerry

Sorted !


Code (autolisp) Select


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



did the trick.
Perfection is not optional.
My other home is TheSwamp