sachindkini Posted April 15, 2023 Posted April 15, 2023 (defun DCL_HH () (VL-FILE-DELETE (STRCAT (GETVAR "TEMPPREFIX") "TMP_H.DCL")) (setq FA1 (OPEN (STRCAT (GETVAR "TEMPPREFIX") "TMP_H.DCL") "a")) (foreach STREAM '("hhimg:dialog{\\n" "label= \"parametric fill : Email : Sachin\" ;\\n" "spacer_1;\\n" ":row{" ":boxed_radio_column{" "label=\"fill style\";\\n" ":radio_button{" "label= \"I-shaped paving\"; key=\"EH1\";}\\n" ":radio_button{" "label= \"Herringbone paving\"; key=\"EH2\";}\\n" ":radio_button{" "label= \"Chamfered rectangle\"; key=\"EH3\";}\\n" ":radio_button{" "label= \"braided texture\"; key=\"EH4\";}\\n" ":radio_button{" "label= \"binary rectangle\"; key=\"EH5\";}}\\n" ":image_button{" "key= \"HHIMG\"; color = -2; width = 30; aspect_ratio = 1; allow_accrpt = true;}}\\n" "spacer_1;\\n" ":row{" ":edit_box{" "label= \"Parameter A\";key= \"CSA\";}\\n" ":edit_box{" "label= \"Parameter B\";key= \"CSB\";}}\\n" "spacer_1;\\n" ":row{" ":button{" "label=\"Select a closed polyline\" ; key=\"YYL\" ; width=10; fixed_width=true; }\\n" ":button{" "label=\"Pick fill interior points\" ; key=\"YYT\" ; width=10; fixed_width=true; }}\\n" ":button{" "label=\"Cancel\" ;key=\"cancel\";is_cancel=true;}}\\n" ) (PRINC STREAM FA1) ) (CLOSE FA1) (setq DCL_T (LOAD_DIALOG (STRCAT (GETVAR "TEMPPREFIX") "TMP_H.DCL"))) (NEW_DIALOG "hhimg" DCL_T) (TC1) DEAR SIR, Error Above Dcl Code Error in dialog file Quote
Steven P Posted April 15, 2023 Posted April 15, 2023 This is what I use in line 1 of a dialog: '( "pass : dialog { key = \"DialogueKey\"; label = \"Dialogue Label\"; " Note I don't have any \\n in mine Finishing I use: (write-line STREAM des) ) ;;end foreach (setq DCL_T (LOAD_DIALOG (STRCAT (GETVAR "TEMPPREFIX") "TMP_H.DCL"))) (NEW_DIALOG "hhimg" DCL_T) Noting that I use (write-line to create the temporary file, you are using princ Try that and see Copy and pasted from other stuff and not checked if I have copied everything (weekend... CAD is off here....) 1 1 Quote
mhupp Posted April 15, 2023 Posted April 15, 2023 (edited) @rlx made this useful lisp to convert stand alone dcl files into lisp. so things have the proper " " and slashes. -Edit Edited April 15, 2023 by mhupp 1 1 2 Quote
rlx Posted April 15, 2023 Posted April 15, 2023 (edited) @mhupp : one of many routines I wrote for fun or just because I was bored (and then only used it once or twice) haha... glad it's still useful. But I wished Autodesk added a dialog editor similar to the VBA form editor. But no problem because in most cases I use last app I made , delete everything except ok-cancel and type in the rest on the fly in new routine (after I made a drawing with design) because like most processes start with a good (block) diagram : how do I want it to look and / or work and then start coding, not the other way around. (defun TC1 ( / dcl-fn dcl-fp dcl-id s drv) (if (setq dcl-fp (open (setq dcl-fn (strcat (getvar "TEMPPREFIX") "TMP_H.DCL")) "w")) (foreach s '("hhimg : dialog {label=\"parametric fill : Email : Sachin\";" "spacer_1;" ":boxed_radio_column {label=\"fill style\";" ":radio_button{label=\"I-shaped paving\"; key=\"EH1\";}" ":radio_button{label=\"Herringbone paving\"; key=\"EH2\";}" ":radio_button{label=\"Chamfered rectangle\"; key=\"EH3\";}" ":radio_button{label=\"braided texture\"; key=\"EH4\";}" ":radio_button{label=\"binary rectangle\"; key=\"EH5\";}" "}" ":image_button {key=\"HHIMG\";color=-2;width=30;aspect_ratio=1;allow_accept=true;}" "spacer_1;" ":row {:edit_box {label=\"Parameter A\";key=\"CSA\";}" ":edit_box {label=\"Parameter B\";key=\"CSB\";}}" "spacer_1;" ":row {:button {label=\"Select a closed polyline\";key=\"YYL\";width=10;fixed_width=true;}" ":button {label=\"Pick fill interior points\";key=\"YYT\";width=10;fixed_width=true;}}" "ok_cancel;" "}" ) (write-line s dcl-fp) ) ) (if dcl-fp (progn (close dcl-fp)(gc))) (if (and (setq dcl-id (load_dialog dcl-fn)) (new_dialog "hhimg" dcl-id)) (progn (action_tile "cancel" "(done_dialog 0)") (action_tile "accept" "(done_dialog 1)") (setq drv (start_dialog)) (if dcl-fn (vl-file-delete dcl-fn)) (cond ((= drv 0)(princ "\nCancelled")) ((= drv 1)(princ "\nok")) ) ) ) (princ) ) (TC1) Edited April 15, 2023 by rlx 2 1 Quote
mhupp Posted April 16, 2023 Posted April 16, 2023 I use it when I come across lisp i like online that use a separate dcl file and want to make them into one file. like this. https://cadtips.cadalyst.com/edit-blocks/nested-block-tree-display 1 Quote
sachindkini Posted April 18, 2023 Author Posted April 18, 2023 28 minutes ago, rlx said: try this sachindkini.lsp 16.82 kB · 2 downloads dear sir, after select pline or pick point command not executed Quote
rlx Posted April 18, 2023 Posted April 18, 2023 ow, only looked at dcl part. no time to look at the rest right now, workstress... Quote
rlx Posted April 18, 2023 Posted April 18, 2023 I had a look at your routine and it looks like its missing some code or hasn't been finished yet. For example when I look at the action_tile for buttons to select a poly line or pick a point they both do (done_dialog 1) which in itself doesn't have to be a bad thing but routine just stops after that. I like the effort though that has been put in vector_image to create the slides. Should be using that myself more often but I admit , I'm a lazy dragon (well I try to be) , so bite me... Quote
BIGAL Posted April 19, 2023 Posted April 19, 2023 This is a radio button dcl generator can be used in any code it needs like 3 lines of code to work, its a library routine gets loaded as required so no hard coding dcl's. Also Multi Getvals & Multi Toggles, Radio buttons 2 col and 3 col. Look at the help in the start of the code for examples. These two steps should be outside of dcl.You can not pick an object without closing dcl so why have them in there. ":row {:button {label=\"Select a closed polyline\";key=\"YYL\";width=10;fixed_width=true;}" ":button {label=\"Pick fill interior points\";key=\"YYT\";width=10;fixed_width=true;}}" 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.