Author Topic: List_box Multiple_select  (Read 9404 times)

0 Members and 1 Guest are viewing this topic.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
List_box Multiple_select
« Reply #15 on: July 19, 2004, 10:52:47 AM »
Oh, i had another look at the error trace

[9.19] (C:TESTB)
.. means you called it from a routine.
You may have to repost the FULL routine for me to have a guess.   .. seems the newstring variable is not being set , and that shouldnt happen, cause the action--accept procedure tests for its value before closing the dialog.

kwb
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
List_box Multiple_select
« Reply #16 on: July 19, 2004, 10:56:08 AM »
PS :

See how handy the  (VL-BT) function is !!

I always use that style of error trap for testing .. it has got me out of the poo a few times now.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List_box Multiple_select
« Reply #17 on: July 19, 2004, 10:59:20 AM »
It seems to work with the single selection but the multiple selection is the one giving the error.
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
List_box Multiple_select
« Reply #18 on: July 19, 2004, 11:12:00 AM »
Cant fault it here .. weird

try this in the c:test0718c  :
Code: [Select]

  (defun do-something (/ workpoint )
    (alert (strcat "Temporary Debug \n" "You Selected: " newstring))  ;; temporary Debug
    (initget 1)
    (setq
      workpoint (getpoint "\n Specify MText insertion point : ")
      objmtext (vla-addmtext kbsg:modelspace
                                 (vlax-3d-point workpoint)
                                 0.0
                                 newstring
                   )
    )
  )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List_box Multiple_select
« Reply #19 on: July 19, 2004, 11:45:15 AM »
Now I get this....

    Command: testb

    Application Error: 10 :- bad argument type: stringp nil
    Backtrace:
[0.58] (VL-BT)
[1.54] (KBSF:DEBUG-SIMPLE-ERROR "bad argument type: stringp nil")
[2.49] (*ERROR* "bad argument type: stringp nil")
[3.44] (_call-err-hook #<SUBR @0cbbc618 *ERROR*> "bad argument type: stringp
nil")
[4.38] (sys-error "bad argument type: stringp nil")
:ERROR-BREAK.33 nil
[5.30] (STRCAT "Temporary Debug \n" "You Selected: " nil)
[6.23] (DO-SOMETHING)
[7.19] (C:TESTB)
[8.15] (#<SUBR @0cbbcde8 -rts_top->)
[9.12] (#<SUBR @026f2334 veval-str-body> "(C:TESTB)" T #<FILE internal>)
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:ARQ-SUBR-CALLBACK.3 (nil 0)
[/list:u]
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
List_box Multiple_select
« Reply #20 on: July 19, 2004, 11:50:45 AM »
ok, GOOD, it gets easier from here ..

The newstring variable is obviously the culpret. Can you post the c:TESTB function ??
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List_box Multiple_select
« Reply #21 on: July 19, 2004, 12:15:39 PM »
Here you go..

Code: [Select]

(defun c:testb (/             dcl_id        index         names
                    starter       programpath   returnlist    objmtext
                    ;;
                    *error*       action-cancel do-something  action-accept
                   )
  ;;-----
  (defun *error* (msg) (kbsf:debug-simple-error msg))
  (defun action-cancel (/) (princ))
      (defun do-something (/ workpoint )
        (alert (strcat "Temporary Debug \n" "You Selected: " newstring))  ;; temporary Debug
        (initget 1)
        (setq
          workpoint (getpoint "\n Specify MText insertion point : ")
          objmtext (vla-addmtext kbsg:modelspace
                                     (vlax-3d-point workpoint)
                                     0.0
                                     newstring
                       )
        )
  )
  (defun action-accept (/ tmp tmpstr)
    (if (and (setq tmp (get_tile "selections"))
             (setq tmpstr     ""
                   returnlist (vl-string-right-trim
                                "\\P"
                                (foreach item (read (strcat "(" tmp ")"))
                                  (setq tmpstr (strcat tmpstr (nth item names) "\\P"))
                                )
                              )
             )
        )
      (done_dialog 101)
      (done_dialog 0)
    )
  )
  ;;-----
  ;;-----
  (setq programpath "c:\\don\\download\\notes\\"
        names       '("01 Monday"      "02 Tuesday"     "03 Wednesday"
                      "Thursday"       "Friday"         "Saturday"
                      "Sunday"         "08 Day Off"
                     )
  )
  (if
    (not
      (new_dialog "dcl0718multiple"
                  (setq dcl_id (load_dialog (strcat programpath "test5.dcl")))
      )
    )
     (exit)
  )
  ;; -- initialise
  (start_list "selections")
  (mapcar 'add_list names)
  (end_list)
  (action_tile "accept" "(action-accept)")
  (setq starter (start_dialog))
  ;; --
  (unload_dialog dcl_id)
  (cond ((= starter 101) (do-something))
        ((<= starter 0) (action-cancel))
  )
  (princ)
)
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
List_box Multiple_select
« Reply #22 on: July 19, 2004, 12:22:59 PM »
In the  do-something procedure for the c:testb function

replace newstring with returnlist , which is the concatenated string for that function.

regards.Kerry
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

V-Man

  • Bull Frog
  • Posts: 343
  • I exist therefore I am! Finally Retired!
List_box Multiple_select
« Reply #23 on: July 20, 2004, 04:31:49 PM »
I'm looking the the help files and I cannot find where in vlisp can you set the height of mtext items created in vlisp.

Is this possible?
AutoCAD 9 - 2023, AutoCADMap 2008 - 2010, Revit 2012 - 2022, Autocad Civil 3D 2023

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
List_box Multiple_select
« Reply #24 on: July 20, 2004, 05:15:28 PM »
Yes. Have a play with this.

Code: [Select]

  (defun do-something (/ workpoint )
    (alert (strcat "Temporary Debug \n" "You Selected: " newstring))  ;; temporary Debug
    (initget 1)
    (setq
      workpoint (getpoint "\n Specify MText insertion point : ")
      objmtext (vla-addmtext kbsg:modelspace
                                 (vlax-3d-point workpoint)
                                 0.0
                                 newstring ;; or returnlist depending on module
                   )
    )
    (vla-put-Height objmtext 50.0)
  )
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.