Help with dialog boxes and layer list

Help with dialog boxes and layer list

tkraftV8RQQ
Explorer Explorer
1,263 Views
4 Replies
Message 1 of 5

Help with dialog boxes and layer list

tkraftV8RQQ
Explorer
Explorer

I have an autolisp command i created that compares overlaps of areas you select by layer.

I'm trying to make a dialog menu (dcl file) but I can't get the layer list (just a simple autolisp list) to show in a dcl Tile of any kind. I'd like it to update whenever the list is updated by prompting the user. There's 4 groups for layer lists and then a "run" option after they're all set.

 

 

0 Likes
Accepted solutions (1)
1,264 Views
4 Replies
Replies (4)
Message 2 of 5

CodeDing
Advisor
Advisor
Accepted solution

@tkraftV8RQQ ,

 

Maybe this example will help you:

Lisp File:

(defun C:TEST ( / dcl_id)
  (setq dcl_id (load_dialog "c:\\myFolder\\mySubFolder\\myfile.dcl")) ; Load the DCL file.
  (if (not (new_dialog "mydialog" dcl_id)) ; Initialize the dialog.
    (exit)                                 ; Exit if this does not work.
  )
  ;define our items
  (setq *myItems* '("Item 1" "Item 2" "Item 3"))
  ;add items to our List box
  (start_list "lstbx_1")
  (mapcar 'add_list *myItems*)
  (end_list)
  ;add items to our Popup box
  (start_list "popbx_1")
  (mapcar 'add_list *myItems*)
  (end_list)
  ;define an action for our button (create a new list in our case)
  (action_tile "btn_1" "(progn
    (alert \"This button will now update the lists.\")
    (setq *myItems* (cons \"Item 9\" (cdr *myItems*)))
    (start_list \"lstbx_1\")
    (mapcar 'add_list *myItems*)
    (end_list)
    (start_list \"popbx_1\")
    (mapcar 'add_list *myItems*)
    (end_list)
    (alert \"The Lists have now been updated.\")
  )")
  ;start dialog
  (start_dialog)         ;Display the dialog box.
  (unload_dialog dcl_id) ;Unload the DCL file.
  (princ)
);defun

DCL File:

mydialog : dialog
{
  label = "My Sample Dialog";
  : list_box {
    key = "lstbx_1";
    label = "My List Box:";
  }
  : popup_list {
    key = "popbx_1";
    label = "My Popup Box:";
  }
  : button {
    key = "btn_1";
    label = "Update Lists";
  }
  ok_only;
}

Best,

~DD

Message 3 of 5

diagodose2009
Collaborator
Collaborator

Here is you see . Must see the file .gif attached.

0 Likes
Message 4 of 5

CodeDing
Advisor
Advisor

^^^ CAUTION ^^^

 

A randomly named .ZIP file, with a short comment expressing you should open said zip file?!

I would recommend to NOT download that file!

 

Message 5 of 5

Sea-Haven
Mentor
Mentor

I use a library list box allows you to change parameters like Title width multi or single etc. 

 

The 1 I use is by Alan J Thomson, Lee-mac.com has two also a single list pick or a nice make a new list where you add items so can see them.

0 Likes