DCL - Popup_list

pierre_costeS8GW8
Enthusiast
Enthusiast

DCL - Popup_list

pierre_costeS8GW8
Enthusiast
Enthusiast

Hello guys,

 

The target is to use attribute tag values from blocks to perform calculations. For that i did a routine that select block, create a list( sublist(block_name1 SWL1 MBL1 EWL1) .....). The "button" on the dialog box is supposed to display the values of the selected block in the popup_list. To extract the values inside the sublist, i use assoc to compare the block_name of the sublist an the one from the popup_list.

 

I have an issue, i am not able to display those values into the dialog box. 

I do not have the expertise to target the issue.

 

You will find attached a .lsp, .dcl and .dwg. 

 

Thank you very much for your help !!!

 

pierre_costeS8GW8_0-1690467576481.png

 

0 Likes
Reply
Accepted solutions (1)
366 Views
5 Replies
Replies (5)

komondormrex
Advisor
Advisor

hello there,

you need to replace

(setq assoc_list_ancill (assoc 'block_ancillary_selection block_att_value_anci_list))

with 

(setq assoc_list_ancill (nth (atoi block_ancillary_selection) block_att_value_anci_list))

0 Likes

pierre_costeS8GW8
Enthusiast
Enthusiast

It is a big step, thank you ! but ....it does not associate the right block_name with the right values ... could you help me out ?

 

0 Likes

komondormrex
Advisor
Advisor
Accepted solution

in that case replace your code with this

(setq assoc_list_ancill (assoc (nth (atoi block_ancillary_selection) ancillary_blocks) block_att_value_anci_list))

0 Likes

pierre_costeS8GW8
Enthusiast
Enthusiast
It does really work the way I expected it, thank you very much !
0 Likes

komondormrex
Advisor
Advisor

you're welcome)

you also may consider to change your code for instant displaying blocks data, like this:

(defun c:TEST_DISPLAY ()

  (vl-load-com)

  (POPO)

  (setq dcl_id (load_dialog "CheatCode.dcl"))
  (if (not (new_dialog "Handle_Data" dcl_id)) (exit))

  (start_list "ObjectList")
  (mapcar 'add_list ancillary_blocks)
  (end_list)

  (Displaying)                             ;****************added
  (action_tile "ObjectList" "(Displaying)");****************added

  (action_tile "button" "(Displaying)")

  (action_tile "accept" "(done_dialog 1)")
  (action_tile "cancel" "(done_dialog 0)")
  (action_tile "help" "(help_button)")

  (start_dialog)
  (unload_dialog dcl_id)

)
0 Likes