jplunus Posté(e) le 18 juin 2020 Posté(e) le 18 juin 2020 Bonjour,grâce à LUNA, j'ai pu alimenter un popup_list avec 2 listes en fonction de la valeur de 2 radio_button.Cette manipulation se faisant par la commande mapcar.Le manque de connaissance de cette commande me ramène vers vous pour alimenter plusieurs popup_list.Les radio_button modelspace et paperspace servent de déclencheur pour alimenter:la key height avec heightmodels pour modelspace 1 et heightpapers pour paperspace 1la key scale avec scalemodels pour modelspace 1 et scalepapers pour papersace 1.J'ai débuté avec height, tout fonctionnait bien !j'ai ajouté scale, il fonctionne, mais height ne fonctionne plus.Mon utilisation de mapcar est erronée !Pouvez-vous me mettre sur le chemin pour la correction.Un grand merci jplunuscouleur1a.lsp
(gile) Posté(e) le 18 juin 2020 Posté(e) le 18 juin 2020 Salut, Le problème vient du fait que tu as deux expressions (action_tile ...) pour la clé "modelspace" et deux pour "paperspace"Essaye comme ça : (defun C:testpopup (/ heightmodels heightpapers scalemodels scalepapers dcl wdcl dcl_id Ok) (setq heightmodels (list "" "13" "18" "25" "35")) (setq heightpapers (list "" "13" "18" "25" "35" "50" "70" "100")) (setq scalemodels (list "" "1" "2" "2.5" "4" "5" "10" "20" "25" "40" "50" "100" "200" "250" "400" "500" "1000" "2000" "2500" "4000" "5000" "10000" "20000" "25000" "40000" "50000" "100000" ) ) (setq scalepapers (list "" "PS")) (setq dcl (vl-filename-mktemp "tmp.dcl") wdcl (ol "w") ) (princ "Testpopuplist:dialog{ label = \"Test\"; : text { label = \"Test popup_list\"; } : row { : column { : radio_row { label = \"Tilemode\"; : radio_button { key = \"modelspace\"; label = \"ModelSpace\"; action = \"(setq mode 1)\"; } : radio_button { key = \"paperspace\"; label = \"PaperSpace\"; action = \"(setq mode 0)\"; } : spacer { height = 0.25; } } : column { label = \"Text Style Attributes\"; children_fixed_width = true; : popup_list { key = \"height\"; label = \"Height\"; alignment = centered; width = 25; } : popup_list { key = \"scale\"; label = \"Scale\"; alignment = centered; width = 25; } : spacer { height = 0.25; } } } } ok_cancel; }" wdcl ) (close wdcl) (setq dcl_id (load_dialog dcl)) (if (not (new_dialog "Testpopuplist" dcl_id)) (exit) ) (if (= (getvar "TILEMODE") 1) (set_tile "modelspace" "1") (set_tile "paperspace" "1") ) (start_list "height") (mapcar 'add_list heightmodels) (end_list) (start_list "scale") (mapcar 'add_list scalemodels) (end_list) (action_tile "modelspace" "(start_list \"height\") (mapcar 'add_list heightmodels) (end_list) (start_list \"scale\") (mapcar 'add_list scalemodels) (end_list)") (action_tile "paperspace" "(start_list \"height\") (mapcar 'add_list heightpapers) (end_list) (start_list \"scale\") (mapcar 'add_list scalepapers) (end_list)") (action_tile "accept" "(done_dialog 1)") (action_tile "cancel" "(done_dialog 0)") (setq Ok (start_dialog)) (unload_dialog dcl_id) (vl-file-delete dcl) Ok ) Gilles Chanteau - gileCAD - GitHub Développements sur mesure pour AutoCAD
Messages recommandés
Créer un compte ou se connecter pour commenter
Vous devez être membre afin de pouvoir déposer un commentaire
Créer un compte
Créez un compte sur notre communauté. C’est facile !
Créer un nouveau compteSe connecter
Vous avez déjà un compte ? Connectez-vous ici.
Connectez-vous maintenant