Search the Community
Showing results for tags 'dcl'.
-
Dear Sir, What is problem in this DCL CODE (setq RX (OPEN (setq LSDCL (VL-FILENAME-MKTEMP "tmp" "" ".dcl")) "w")) (WRITE-LINE "tccz:dialog{" RX) (WRITE-LINE " label=\"Layer Operations\";" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :button{label=\"object select\";key=\"accept\";is_default=true;fixed_width=true;width=4;}" RX) (WRITE-LINE " :button{label=\"Dim Select\";key=\"notuxian\";fixed_width=true;width=4;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :button{label=\"Isolate Select\";key=\"geli\";fixed_width=true;width=4;}" RX) (WRITE-LINE " :button{label=\"Close Select\";key=\"nogeli\";fixed_width=true;width=4;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :button{label=\"Lock Select\";key=\"suoding\";fixed_width=true;width=4;}" RX) (WRITE-LINE " :button{label=\"Lock Unselect\";key=\"nosuoding\";fixed_width=true;width=4;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :button{label=\"Freeze Select\";key=\"dongjie\";fixed_width=true;width=4;}" RX) (WRITE-LINE " :button{label=\"Freeze Unselect\";key=\"nodongjie\";fixed_width=true;width=4;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :text{value=\"when the command is first executed\";is_enabled=flash;\\n fixed_width=true;width=29;fixed_height=true;height=0;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :button{label=\"Color uniformity\";key=\"bylayer\";fixed_width=true;width=4;}" RX) (WRITE-LINE " :button{label=\"Restore\";key=\"huifu\";fixed_width=true;width=4;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :row{" RX) (WRITE-LINE " :button{label=\"Layer Management\";key=\"state\";fixed_width=true;width=4;}" RX) (WRITE-LINE " :button{label=\"cancel\";key=\"cancel\";is_cancel=true;fixed_width=true;width=14;\\n fixed_height=true;height=1;is_enabled=true;is_flash=true;}" RX) (WRITE-LINE " }" RX) (WRITE-LINE " :toggle{label=\"Continue last status\";key=\"continu\";fixed_width=true;width=4;}" RX) (WRITE-LINE " }" RX) (CLOSE RX)
-
List variables to block attributes with lisp
Kris Malen posted a topic in AutoLISP, Visual LISP & DCL
Can someone help me out with changing the attributes of a block using a list. The block is used in a leader. The block has 7 attributes, but my list doesn't always contain 7 variables. I have tried to implement Lee Mac's code dynamicblockfunctions, but I keep getting the error "too few arguments". I would like to import the leader when the calculation is done, and for the block to then automatically change the attributes to the variables in the list. Here's my current code: (defun c:testKRIS ( / *error* dch dcl des mv d1 d2 d3 d4 d5 d6) (defun *error* ( msg ) (if (and (= 'int (type dch)) (< 0 dch)) (unload_dialog dch) ) (if (= 'file (type des)) (close des) ) (if (and (= 'str (type dcl)) (findfile dcl)) (vl-file-delete dcl) ) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (cond ( (not (setq dcl (vl-filename-mktemp nil nil ".dcl") des (open dcl "w") ) ) (princ "\nUnable to open DCL for writing.") ) ( (progn (foreach str '( "ed : edit_box" "{" " alignment = left;" " width = 20;" " edit_width = 10;" " fixed_width = true;" "}" "" "test : dialog" "{" " spacer;" " key = \"dcl\";" " : ed" " {" " key = \"mv\";" " label = \"MV:\";" " }" " :boxed_column { " " label = \"Diepte vd buizen\";" " :row {" " : ed" " {" " key = \"d1\";" " label = \"A:\";" " }" " : ed" " {" " key = \"d4\";" " label = \"X:\";" " }}" " :row {" " : ed" " {" " key = \"d2\";" " label = \"B:\";" " }" " : ed" " {" " key = \"d5\";" " label = \"Y:\";" " }}" " :row {" " : ed" " {" " key = \"d3\";" " label = \"C:\";" " }" " : ed" " {" " key = \"d6\";" " label = \"Z:\";" " }}" " }" " : boxed_row" " { " " label = \"BOK berekeningen\";" " :column {" " : ed { key = \"res\"; label = \"BOK:\"; is_enabled = false; }" " : ed { key = \"res2\"; label = \"BOK2:\"; is_enabled = false; }" " : ed { key = \"res3\"; label = \"BOK3:\"; is_enabled = false; }" " }" " :column{" " : ed { key = \"res4\"; label = \"BOK4:\"; is_enabled = false; }" " : ed { key = \"res5\"; label = \"BOK5:\"; is_enabled = false; }" " : ed { key = \"res6\"; label = \"BOK6:\"; is_enabled = false; }" " }" " }" " : button" " {" " key = \"cal\";" " label = \"Calculate\";" " }" " spacer;" " ok_only;" "}" ) (write-line str des) ) (setq des (close des) dch (load_dialog dcl) ) (<= dch 0) ) (princ "\nUnable to load DCL file.") ) ( (not (new_dialog "test" dch)) (princ "\nUnable to display 'test' dialog.") ) ( t (set_tile "dcl" "Calculate Area") (action_tile "mv" "(setq mv $value)") (action_tile "d1" "(setq d1 $value)") (action_tile "d2" "(setq d2 $value)") (action_tile "d3" "(setq d3 $value)") (action_tile "d4" "(setq d4 $value)") (action_tile "d5" "(setq d5 $value)") (action_tile "d6" "(setq d6 $value)") (action_tile "cal" (vl-prin1-to-string '( (lambda ( / m x y z a b c lijst_results ) (setq lijst_results '()) (set_tile "res" "") (set_tile "res2" "") (set_tile "res3" "") (set_tile "res4" "") (set_tile "res5" "") (set_tile "res6" "") (setq m (distof mv)) (if m (progn (setq lijst_results (append lijst_results (list (strcat "mv: " (rtos m 2 2))))) (if (and d1 (setq a (distof d1))) (progn (setq lijst_results (append lijst_results (list (strcat "A: " (rtos (- m a) 2 2))))) (set_tile "res" (rtos (- m a) 2 2)))) (if (and d2 (setq b (distof d2))) (progn (setq lijst_results (append lijst_results (list (strcat "B: " (rtos (- m b) 2 2))))) (set_tile "res2" (rtos (- m b) 2 2)))) (if (and d3 (setq c (distof d3))) (progn (setq lijst_results (append lijst_results (list (strcat "C: " (rtos (- m c) 2 2))))) (set_tile "res3" (rtos (- m c) 2 2)))) (if (and d4 (setq x (distof d4))) (progn (setq lijst_results (append lijst_results (list (strcat "X: " (rtos (- m x) 2 2))))) (set_tile "res4" (rtos (- m x) 2 2)))) (if (and d5 (setq y (distof d5))) (progn (setq lijst_results (append lijst_results (list (strcat "Y: " (rtos (- m y) 2 2))))) (set_tile "res5" (rtos (- m y) 2 2)))) (if (and d6 (setq z (distof d6))) (progn (setq lijst_results (append lijst_results (list (strcat "Z: " (rtos (- m z) 2 2))))) (set_tile "res6" (rtos (- m z) 2 2)))) (print lijst_results) ) (alert "Vul maaiveld waarden in.") ) ) ) ) ) (start_dialog) ) ) (*error* nil) (princ) ) -
Change values of dynamic block with outcomes
Kris Malen posted a topic in AutoLISP, Visual LISP & DCL
I want to change the values of a dynamic block within a lisp. This lisp contains a calculation. I used .dcl for this. My dynamic block has 7 attributes: maaiveld, HOOGTE1, HOOGTE2, HOOGTE3, HOOGTE4, HOOGTE5 and HOOGTE6. My lisp code has 7 values: m, a, b, c, x, y and z The order of these outputs are important. a, b, and c are sewer pipes that arrive in the cewer, and x, y, and z are pipes that depart from the sewer pit. So if there are only 2 pipes, we only have to use a and x. This makes it difficult. I can't just set HOOGTE1 to a, HOOGTE2 to b, HOOGTE3 to c, etc. If I do it this way, it will leave a gap in my leader. I hope this is even possible. I provided some screenshots of my calculator and of the leader, and the problem of the gap. Maybe I just need to create a more complex dynamic block, so that I can just connect the hoogte1,2,3,... to a,b,c,... I really don't know. code: (defun c:testKRIS ( / *error* dch dcl des mv d1 d2 d3 d4 d5 d6) (defun *error* ( msg ) (if (and (= 'int (type dch)) (< 0 dch)) (unload_dialog dch) ) (if (= 'file (type des)) (close des) ) (if (and (= 'str (type dcl)) (findfile dcl)) (vl-file-delete dcl) ) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (cond ( (not (setq dcl (vl-filename-mktemp nil nil ".dcl") des (open dcl "w") ) ) (princ "\nUnable to open DCL for writing.") ) ( (progn (foreach str '( "ed : edit_box" "{" " alignment = left;" " width = 20;" " edit_width = 10;" " fixed_width = true;" "}" "" "test : dialog" "{" " spacer;" " key = \"dcl\";" " : ed" " {" " key = \"mv\";" " label = \"MV:\";" " }" " :boxed_column { " " label = \"Diepte vd buizen\";" " :row {" " : ed" " {" " key = \"d1\";" " label = \"A:\";" " }" " : ed" " {" " key = \"d4\";" " label = \"X:\";" " }}" " :row {" " : ed" " {" " key = \"d2\";" " label = \"B:\";" " }" " : ed" " {" " key = \"d5\";" " label = \"Y:\";" " }}" " :row {" " : ed" " {" " key = \"d3\";" " label = \"C:\";" " }" " : ed" " {" " key = \"d6\";" " label = \"Z:\";" " }}" " }" " : boxed_row" " { " " label = \"BOK berekeningen\";" " :column {" " : ed { key = \"res\"; label = \"BOK:\"; is_enabled = false; }" " : ed { key = \"res2\"; label = \"BOK2:\"; is_enabled = false; }" " : ed { key = \"res3\"; label = \"BOK3:\"; is_enabled = false; }" " }" " :column{" " : ed { key = \"res4\"; label = \"BOK4:\"; is_enabled = false; }" " : ed { key = \"res5\"; label = \"BOK5:\"; is_enabled = false; }" " : ed { key = \"res6\"; label = \"BOK6:\"; is_enabled = false; }" " }" " }" " : button" " {" " key = \"cal\";" " label = \"Calculate\";" " }" " spacer;" " ok_only;" "}" ) (write-line str des) ) (setq des (close des) dch (load_dialog dcl) ) (<= dch 0) ) (princ "\nUnable to load DCL file.") ) ( (not (new_dialog "test" dch)) (princ "\nUnable to display 'test' dialog.") ) ( t (set_tile "dcl" "Calculate Area") (action_tile "mv" "(setq mv $value)") (action_tile "d1" "(setq d1 $value)") (action_tile "d2" "(setq d2 $value)") (action_tile "d3" "(setq d3 $value)") (action_tile "d4" "(setq d4 $value)") (action_tile "d5" "(setq d5 $value)") (action_tile "d6" "(setq d6 $value)") (action_tile "cal" (vl-prin1-to-string '( (lambda ( / m x y z a b c ) (set_tile "res" "") (set_tile "res2" "") (set_tile "res3" "") (set_tile "res4" "") (set_tile "res5" "") (set_tile "res6" "") (cond ( (or (not mv) (= "" mv)) (alert "Please enter a maaiveld value.") (mode_tile "mv" 2) ) ( (or (not d1) (= "" d1)) (alert "Please enter a A value.") (mode_tile "d1" 2) ) ( (or (not d2) (= "" d2)) (alert "Please enter a B value.") (mode_tile "d2" 2) ) ( (or (not d3) (= "" d3)) (alert "Please enter a C value.") (mode_tile "d3" 2) ) ( (or (not d4) (= "" d4)) (alert "Please enter a X value.") (mode_tile "d4" 2) ) ( (or (not d5) (= "" d5)) (alert "Please enter a Y value.") (mode_tile "d5" 2) ) ( (or (not d6) (= "" d6)) (alert "Please enter a Z value.") (mode_tile "d6" 2) ) ( (not (setq m (distof mv))) (alert "Het Maaiveld moet een getal zijn.") (mode_tile "mv" 2) ) ( (not (setq a (distof d1))) (alert "The A must be numerical.") (mode_tile "d1" 2) ) ( (not (setq b (distof d2))) (alert "The B must be numerical.") (mode_tile "d2" 2) ) ( (not (setq c (distof d3))) (alert "Het C moet een getal zijn.") (mode_tile "d3" 2) ) ( (not (setq x (distof d4))) (alert "The X must be numerical.") (mode_tile "d4" 2) ) ( (not (setq y (distof d5))) (alert "The Y must be numerical.") (mode_tile "d5" 2) ) ( (not (setq z (distof d6))) (alert "The Z must be numerical.") (mode_tile "d6" 2) ) ( (<= m 0.0) (alert "Het maaiveld moet groter dan nul zijn.") (mode_tile "mv" 2) ) ( (<= a 0.0) (alert "The A must be greater than zero.") (mode_tile "d1" 2) ) ( (<= b 0.0) (alert "The B must be greater than zero.") (mode_tile "d2" 2) ) ( (<= c 0.0) (alert "Het C moet groter dan nul zijn.") (mode_tile "d3" 2) ) ( (<= x 0.0) (alert "The X must be greater than zero.") (mode_tile "d4" 2) ) ( (<= y 0.0) (alert "The Y must be greater than zero.") (mode_tile "d5" 2) ) ( (<= z 0.0) (alert "The Z must be greater than zero.") (mode_tile "d6" 2) ) (t (set_tile "res" (rtos (- m a) 2)) (set_tile "res2" (rtos (- m b) 2)) (set_tile "res3" (rtos (- m c) 2)) (set_tile "res4" (rtos (- m x) 2)) (set_tile "res5" (rtos (- m y) 2)) (set_tile "res6" (rtos (- m z) 2)) ) ) ) ) ) ) (start_dialog) ) ) (*error* nil) (princ) ) The code needs work to be visually better, but I want it to work before I do that.- 6 replies
-
- dynamicblocks
- lisp
-
(and 2 more)
Tagged with:
-
Our surveyors have asked me to create a calculation interface. I wanted to create a lisp program with an interface where the surveyors could input their measurements. They typically measure the ground level of a sewer pit and then the depth of the sewer pipes. To get the level of the sewer pipes, they subtract the ground level from their measurements. However, I have some difficulties getting the interface to function. I came across code by Lee Mac and attempted to build upon it. My code is half in Dutch, 'MV' stands for Ground Level. I've attached a screenshot of my current progress. The issue is that the second calculation isn't being displayed. I would also want my outputs to have 2 decimals. lisp code: (defun c:test ( / *error* dch dcl des mv wid diepte) (defun *error* ( msg ) (if (and (= 'int (type dch)) (< 0 dch)) (unload_dialog dch) ) (if (= 'file (type des)) (close des) ) (if (and (= 'str (type dcl)) (findfile dcl)) (vl-file-delete dcl) ) (if (and msg (not (wcmatch (strcase msg t) "*break,*cancel*,*exit*"))) (princ (strcat "\nError: " msg)) ) (princ) ) (cond ( (not (setq dcl (vl-filename-mktemp nil nil ".dcl") des (open dcl "w") ) ) (princ "\nUnable to open DCL for writing.") ) ( (progn (foreach str '( "ed : edit_box" "{" " alignment = left;" " width = 20;" " edit_width = 10;" " fixed_width = true;" "}" "" "test : dialog" "{" " spacer;" " key = \"dcl\";" " : ed" " {" " key = \"mv\";" " label = \"MV:\";" " }" " : ed" " {" " key = \"wid\";" " label = \"Width:\";" " }" " : ed" " {" " key = \"diepte\";" " label = \"A:\";" " }" " : row" " {" " : ed { key = \"res\"; label = \"BOK:\"; is_enabled = false; }" " : ed { key = \"res2\"; label = \"BOK2:\"; is_enabled = false; }" " : button" " {" " key = \"cal\";" " label = \"Calculate\";" " }" " }" " spacer;" " ok_only;" "}" ) (write-line str des) ) (setq des (close des) dch (load_dialog dcl) ) (<= dch 0) ) (princ "\nUnable to load DCL file.") ) ( (not (new_dialog "test" dch)) (princ "\nUnable to display 'test' dialog.") ) ( t (set_tile "dcl" "Calculate Area") (action_tile "mv" "(setq mv $value)") (action_tile "wid" "(setq wid $value)") (action_tile "diepte" "(setq diepte $value)") (action_tile "cal" (vl-prin1-to-string '( (lambda ( / x y z) (set_tile "res" "") (set_tile "res2" "") (cond ( (or (not mv) (= "" mv)) (alert "Please enter a maaiveld value.") (mode_tile "mv" 2) ) ( (or (not wid) (= "" wid)) (alert "Please enter a width value.") (mode_tile "wid" 2) ) ( (or (not diepte) (= "" diepte)) (alert "Please enter a a value.") (mode_tile "diepte" 2) ) ( (not (setq x (distof mv))) (alert "Het Maaiveld moet een getal zijn.") (mode_tile "mv" 2) ) ( (not (setq y (distof wid))) (alert "The width must be numerical.") (mode_tile "wid" 2) ) ( (not (setq z (distof diepte))) (alert "The diepte must be numerical.") (mode_tile "diepte" 2) ) ( (<= x 0.0) (alert "Het maaiveld moet groter dan nul zijn.") (mode_tile "mv" 2) ) ( (<= y 0.0) (alert "The width must be greater than zero.") (mode_tile "wid" 2) ) ( (<= z 0.0) (alert "The width must be greater than zero.") (mode_tile "diepte" 2) ) ( (set_tile "res" (rtos (- x y) 2))) ( (set_tile "res2" (rtos (- x z) 2))) ) ) ) ) ) (start_dialog) ) ) (*error* nil) (princ) ) If I manage to fix this then I will try to make a leader with the outputs.
- 4 replies
-
- calculation
- lisp
-
(and 2 more)
Tagged with:
-
Is there any chance of matchline automation using lisp in layout? I have attached sample dwg and screenshot of block for matchline. Please help. And thanks in advance. SRS.dwg
-
Inserting MLEADER with diagonally stack fractions in text
EYNLLIB posted a topic in AutoLISP, Visual LISP & DCL
I have some lisp / DCL code that allows me to pick a note from a lstbox and insert it as an MLEADER into the drawing. How should I format that note text in my code so that the fractions insert into the drawing as diagonally stacked fractions? I've tried 3#4 but it shows up just as written, not stacked diagonally Thanks for any help -
Hi, Written a tool for replacing (updating) blocks. Had some spare time untill my boss recently used the W-word again (work , yak!) Anywayz , its a prototype so I'm not sure its stable and safe yet because I only did some lab testing. I hope it will be usefull. Not sure if I will be able to work on it further any time soon because I still have a few ideas and wishes. gr. Rlx RlxBlk manual.doc RlxBlk.lsp RlxBlk.dcl
-
How do convert .png to nr list for my DCL image?
GroundWolf61 posted a topic in AutoLISP, Visual LISP & DCL
How do convert .png to nr list for my DCL image? HI, i would like to insert an image in to my DCL. But how do i convert a image to a list of pixels? THX like in this code. V V V V V (steal:image "refresh" '( -15 -15 -15 -15 -15 -15 -15 -15 -15 009 163 165 165 173 163 009 -15 -15 -15 -15 -15 -15 -15 -15 -15 161 -15 -15 -15 -15 -15 161 175 164 164 154 175 173 171 171 163 161 -15 -15 -15 -15 -15 -15 -15 154 153 -15 -15 254 175 166 166 166 166 164 164 175 173 171 161 161 163 254 -15 -15 -15 -15 -15 154 154 163 254 164 166 166 166 166 166 166 164 154 175 152 171 161 151 163 254 -15 -15 -15 -15 154 154 154 164 166 166 166 166 166 164 165 153 009 009 161 173 173 161 151 163 254 -15 -15 -15 154 162 154 164 166 166 166 166 165 254 -15 -15 -15 -15 -15 -15 254 163 171 151 163 -15 -15 -15 152 152 162 154 164 166 166 153 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 153 171 161 009 -15 -15 152 152 152 154 154 164 164 254 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 153 161 163 -15 -15 152 152 152 152 154 154 164 164 151 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 163 171 -15 -15 152 150 150 152 152 154 164 166 156 153 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 151 163 254 -15 152 152 152 152 152 154 154 154 177 164 009 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 173 009 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 165 009 254 154 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 152 254 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 154 175 175 175 175 175 165 173 173 173 -15 -15 152 153 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 161 164 166 166 166 164 175 173 173 173 -15 -15 152 152 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 164 166 166 166 177 175 173 173 -15 -15 153 150 163 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 254 156 166 166 164 175 173 173 -15 -15 254 152 150 163 -15 -15 -15 -15 -15 -15 -15 -15 -15 -15 009 156 166 166 166 164 175 173 -15 -15 -15 163 150 150 173 254 -15 -15 -15 -15 -15 -15 -15 163 156 166 166 166 166 166 175 165 -15 -15 -15 -15 152 150 150 152 173 161 009 009 161 163 154 156 166 166 166 166 166 164 177 165 -15 -15 -15 -15 254 152 150 150 152 152 162 154 154 154 164 156 156 166 166 156 151 173 164 175 -15 -15 -15 -15 -15 254 152 152 152 152 162 162 162 154 154 164 156 156 156 009 -15 -15 173 175 -15 -15 -15 -15 -15 -15 -15 161 152 152 152 152 152 162 154 154 154 163 -15 -15 -15 -15 -15 173 -15 -15 -15 -15 -15 -15 -15 -15 -15 009 163 165 152 165 163 161 -15 -15 -15 -15 -15 -15 -15 -15 -15 ) ) (defun steal:image ( key lst / i j s x y ) (setq s (fix (sqrt (length lst)))) (repeat (setq i s) (setq j 1) (repeat s (setq x (cons j x) y (cons i y) j (1+ j) ) ) (setq i (1- i)) ) (start_image key) (fill_image 0 0 (dimx_tile key) (dimy_tile key) -15) (mapcar 'vector_image x y x y lst) (end_image) ) -
Hi all, this is a cutout of a dcl file with toggle boxes. How can I predefine the selection "lathe machine"? (So that this checkbox is always checked). Currently, the selection that was previously selected is always applied. With radio-buttons it works with "value=1", but not in this case. : toggle { key = "tool"; label = "lathe machine"; value = "1"; } Thanks so far.
-
Hi all, I have rebuilt the dcl and lsp files for my purposes. Can someone show me how to query the set variable (with wcmatch or cond)? Thanks in advance. (defun c:MyToggles (/ Dcl_Id% Layout_A1H$ Layout_A2H$ Layout_A3V$ Layout_A3H$ Layout_A4V$ Layout_A4H$ Return#) ;----- set default variables (if (not *MyToggles@) ;unique global variable name to store dialog info (setq *MyToggles@ (list nil "0" "0" "0" "0" "0" "0")) ) (setq Layout_A1H$ (nth 1 *MyToggles@) Layout_A2H$ (nth 2 *MyToggles@) Layout_A3V$ (nth 3 *MyToggles@) Layout_A3H$ (nth 4 *MyToggles@) Layout_A4V$ (nth 5 *MyToggles@) Layout_A4H$ (nth 6 *MyToggles@) ) ;----- load dialog dcl data (setq Dcl_Id% (load_dialog "MyDialogs.dcl")) (new_dialog "MyToggles" Dcl_Id%) ;----- set dialog initial settings (set_tile "A1H" Layout_A1H$) (set_tile "A2H" Layout_A2H$) (set_tile "A3V" Layout_A3V$) (set_tile "A3H" Layout_A3H$) (set_tile "A4V" Layout_A4V$) (set_tile "A4H" Layout_A4H$) ;----- dialog actions (action_tile "A1H" "(setq Layout_A1H$ $value)") (action_tile "A2H" "(setq Layout_A2H$ $value)") (action_tile "A3V" "(setq Layout_A3V$ $value)") (action_tile "A3H" "(setq Layout_A3H$ $value)") (action_tile "A4V" "(setq Layout_A4V$ $value)") (action_tile "A4H" "(setq Layout_A4H$ $value)") (setq Return# (start_dialog)) ;----- Unload Dialog (unload_dialog Dcl_Id%) (setq *MyToggles@ (list nil Layout_A1H$ Layout_A2H$ Layout_A3V$ Layout_A3H$ Layout_A4V$ Layout_A4H$)) (princ) ;c:MyToggles ) MyToggles : dialog { key = "Title"; label = "Layouts"; //title from lsp file spacer; : boxed_column { label = "Get your Layouts:"; width = 34.26; fixed_width = true; : toggle { key = "A1H"; label = "A1 - Horizontal"; } : toggle { key = "A2H"; label = "A2 - Horizontal"; } : toggle { key = "A3V"; label = "A3 - Vertikal"; } : toggle { key = "A3H"; label = "A3 - Horizontal"; value = "1" ; //predefined selection } : toggle { key = "A4V"; label = "A4 - Vertikal"; } : toggle { key = "A4H"; label = "A4 - Horizontal"; } spacer; } spacer; ok_only; } How do I include the variable query here? (cond ((= Layout_A1H$ 1) "selected") ('T "not selected") )
-
Ignore empty DCL input boxes when performing extrude multiple objects.
dimka posted a topic in AutoLISP, Visual LISP & DCL
I have multiple objects that are closed polylines and need to enter the extrude value through the DCL interface. Some of the input boxes are left empty/blank, meaning some of object I don’t want to extrude. When I want to extrude, the script will stop when it encounters a blank or 0 value. How can I write a script to skip the blank input box? Due to limited skill, I am very basic lisp experience and DCL to complete this lisp. I hope everyone can help, thank you this is the lisp (defun c:3dext1 () (setq AR "arlayer") ;AR (setq CO "colayer") ;CO (setq FR "frlayer") ;FR (dcl_3dextr) (princ) ) (defun dcl_3dextr ( ) (setq dcl_id_PARA (load_dialog "3Dextr.dcl")) (if (not (new_dialog "dextr" dcl_id_PARA)) (exit) ) (set_tile "arval" "") (set_tile "coval" "") (set_tile "frval" "") (action_tile "accept-ht" "(get_1ht) (done_dialog 1)") (action_tile "cancel" "(done_dialog)") (setq dd (start_dialog)) (cond ((= dd 1) (main-extru)) ) (unload_dialog dcl_id_PARA) ) (defun get_1ht () (setq arh (atof (get_tile "arval"))) (setq coh (atof (get_tile "coval"))) (setq frh (atof (get_tile "frval"))) ) (defun main-extru (/) (command "_.view" "_swiso" ) (command "_.zoom" "_extents") (command "_.LAYER" "_T" AR "_S" AR "_F" "*" "") (command "_.extrude" "all" "" arh ) (command "_.LAYER" "_T" CO "_S" CO "_F" "*" "") (command "_.extrude" "all" "" coh ) (command "_.LAYER" "_T" FR "_S" FR "_F" "*" "") (command "_.extrude" "all" "" frh ) (princ) ) ;_ defun DCL here dextr : dialog { label = "extrude by val" ; :row { : edit_box {key = "arval"; label = "a"; edit_width = 3; value = "000";} : edit_box {key = "coval"; label = "c"; edit_width = 3; value = "000";} : edit_box {key = "frval"; label = "f"; edit_width = 3; value = "000";} : button { label = "OK"; key = "accept-ht"; width = 12; fixed_width = true; mnemonic = "O"; } : button { label = "Cancel"; key = "cancel"; width = 12; fixed_width = true; mnemonic = "C"; is_cancel = true; } } } -
Hello i want to ask if it possible to add scroll bar in boxed_column when size is bigger than fixed. Something like this and when i have more than 5-6 lines i want scroll bar not THIS Trudy : dialog { label ="Test1"; spacer; :boxed_column { label = "TRY1"; width = 30; height = 10; : row { : edit_box { key = "cod"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod1"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod1"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod2"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod2"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod3"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod3"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod4"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod4"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod5"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod5"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod6"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod6"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod7"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod7"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod8"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod8"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } : row { : edit_box { key = "cod9"; label = "CODE" ; width = 10; fixed_width = true; } : popup_list { key = "mod9"; color = 1; label = "MODE"; width = 20; fixed_width = true; allow_accept = true; } } } ok_cancel; } Thank you
- 11 replies
-
- dcl
- scroll bar
-
(and 2 more)
Tagged with:
-
Hello, i try to insert block view in dcl format. I want when i chose block name to have block view to. Something like this.
-
MCOLLAR.LSPMCOLLAR.DCL Collar Drawing.dwg Hey Guys yet with another question: I created this DCL that has 5 user input and I would like it to draw this complicated collar for me. Basically, the size of the mast (monopole diameter) is given together with the thickness of the collar plate (which is the same thickness for the ring plate), then there are some fixed values that can be assumed to draw this. Hopefully 1/3 can be drawn and then array at 120 deg. DWG I posted would be a better representative. The number of bolts (5 rows shown on this picture) is only the best fit for the support - I would like it to give me all options to choose from (3 bolt pattern all the way to 9 rows). Then to make it even harder, I would like to create a shop drawing (as shown on dwg) that has detailed plan so it really should be drawn in 4 pieces (for that 1/3 of the pie) to then assign layer and hatch. Can someone drag me to the right direction and show me how to draw stuff with different arcs and trims and offsets PLEASE! I was so excited to finally show drop down menu on a DCL, now that is done, I do not know how to draw an arc with specific geometry in lisp. Thanks
-
Version 1.0.1
1,271 downloads
Thank you for supporting this "HP:BUTTONS.lsp" DCL library. This routine allows you to create DCL with multiple buttons associated to DCL action_tile list on the fly. It creates DCL box with single column x nRows of buttons, 'n' depends on the length of the 'action list' usage: (hp:buttons title lst width ht) title = Name caption on top of DCL - string lst = quoted list or progn list - list width = Width of the dialod box - integer ht = height of each button - integer returns nil or any execution (progn ... ) related to action_tile Save this file into your support folder, append to your startup autoload routine. In order to optimize the user experience, it allows maxinum 15 rows however you can abjust depends on screen size. HP:BUTTONS - v1.0 Free LISP by - hanhphuc email: hanhphuc.diy@outlook.com -
I can convert my raw AutoLISP (.lsp) codes into Visual Lisp (.VLX) and .FAS application using AutoCAD VLISP IDE. I was looking into Autodesk App Store and downloaded some of the free applications. It was .msi. That means it will install directly on Windows and link-up with installed AutoCAD. I am very new in the App Store. Could you please help me to understand to convert my .lsp or .vlx or .fas into .msi? Thanks.
- 4 replies
-
- autolisp
- visual lisp
-
(and 3 more)
Tagged with:
-
Lisp for connect between attribute definition values (Electrical Lisp)
jntm226 posted a topic in AutoLISP, Visual LISP & DCL
TL;DR I need to connect blocks using attribute values. I created multiple blocks and attribute with different properties (Annotative, scaled attribute text to 1:50, Upside down, Backward, Invisible, Constant, Verify, Preset, Multiple lines, Lock position, Visibility parameters) Request 1: I need to request for help to create a lisp for connect with *lines between attribute definition values since their attribute insertion point or block insertion point, ignoring all properties, included caps, but Visibility parameters not should be ignored, all this just of selected blocks (dynamic blocks, regular blocks, nested blocks). (check dwg attached for more details) Request 2: Add an option for let me choice if I need to ignore just specific attributes tag. (in the attached drawing I ignored between attributes values “tipo” and “nivel”) Request 2: Add an option for let me choice if I need connect just specific attributes tag. (in the attached drawing I connected between attributes values “codigo” and “alimentador”) Request 3: Add an option for let me choice for connect blocks insert point or attribute definitions insert point (check dwg file and images for more details) PD: attached blocks with the name “connect attributes.dwg” PD: if possible use DCL or OpenDCL for the GUI. connect attributes.dwg -
I am trying to accomplish this lisp with no knowledge of DCL since I can check and uncheck options when I want. (Typ.) (Type) (TYP.) (TYPE) ± c/c ;option1; ± ;Dimension; c/c or C/C ;option2; ± ;Dimension; c/c or C/C then underneath the dim line to be: all four options of (Typ.)(Type)(TYP.)(TYPE) previously I had made a few lisps to do the task but it seems a DCL would be the way to go: ; Adding (Type) to the dimension line with Arial text (defun c:2 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;end of 1st. progn (progn (setq Txt (strcat "<> " "{\\fArial|b0|i0|c0|p34;(Type)}")) (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ; ) ; end if (princ) ) ;End Defun ; Adding ± to the dimension line keeping dim style (defun c:4 (/ Rtrn txt ss in vl) (progn (princ "\nSelect Dimension to modify: ") (setq ss (ssget "_:L" '((0 . "DIMENSION")))) ) ;end of 1st. progn (progn (setq Txt (strcat "%%P<>")) (repeat (setq in (sslength ss)) (setq vl (vlax-ename->vla-object (ssname ss (setq in (1- in))))) (vl-catch-all-apply 'vla-put-TextOverride (list vl txt)) ) ) ;end 2nd. progn ; ) ; end if (princ) ) ;End Defun for now I have them each under a command but it would be nice to have them using DCL. You see some pre/suffixes are all capital and some regular. also some are taking the dimension style formatting and some are Arial. Any help please? thank you!
-
Hello, I just want to ask regarding the program I want to make cause I am having a problem on how to multiply the two values ( a real number and value from an input box): Part of my DCL; : edit_box { key = "sc"; label = "ENTER SCALE :"; alignment = centered; width = 10; fixed_width = true; is_enabled = false;} Part in my LISP; (set_tile "sc" "500") (mode_tile "sc" 2) (action_tile "en" "(progn (setq en $value)(mode_tile \"sc\" 0))") (action_tile "accept" "(setq scale (get_tile \"sc\") (done_dialog 1) )" ) (defun Styles() (setq size (* 0.00225 scale)) ….) but after running the program just exit. Hope someone can have time to help with this. Thank you!
-
Hi there! I am exploring lisp and dcl at the same time. I have this DCL as shown below. Whenever the command is done and doing the same command again, values reset (pic2). I want the values to remain whenever I used the dcl again after I press "Ok" to edit particular inputs instead of typing the whole data again. How could I possibly do that? Here is the dcl code I used. CHECKING : dialog { label = "CHECKING"; : row { :boxed_row { label = "PARAMETERS"; : edit_box { key = "a"; label = "Wind Pressure (kPa)"; edit_width = 8;} : edit_box {key = "b"; label = "Tributary Width (mm)"; edit_width = 8;} : edit_box {key = "c"; label = "Unsupported Length (mm)"; edit_width = 8;} } } : row { :boxed_column { label = "SECTION PROPERTIES (ALUMINUM)"; : edit_box { key = "d"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "e"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "f"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "g"; label = "Allowable Stress (MPa)"; edit_width = 8;} } :boxed_column { label = "SECTION PROPERTIES (STEEL)"; : edit_box { key = "h"; label = "Moment of Inertia (mm^4)"; edit_width = 8;} : edit_box {key = "i"; label = "Area (mm^2)"; edit_width = 8;} : edit_box {key = "j"; label = "Extreme Fiber (mm)"; edit_width = 8;} : edit_box {key = "k"; label = "Allowable Stress (MPa)"; edit_width = 8;} } } : button { key = "accept"; label = " &OK "; is_default = true; mnemonic = "S"; } : button { key = "cancel"; label = " Cancel "; is_default = false; is_cancel = true; } } and here is the lisp code: (defun saveVars() (setq wp(distof(get_tile "a"))) (setq tw(distof(get_tile "b"))) (setq L(distof(get_tile "c"))) (setq Im(distof(get_tile "d"))) (setq Am(distof(get_tile "e"))) (setq cm(distof(get_tile "f"))) (setq Fbm(distof(get_tile "g"))) (setq Is(distof(get_tile "h"))) (setq As(distof(get_tile "i"))) (setq cs(distof(get_tile "j"))) (setq Fbs(distof(get_tile "k"))) ) (defun C:CC() (if(not(setq dcl_id (load_dialog "CHECKING.dcl"))) (progn (alert "The DCL file could not be loaded!") (exit) ) (progn (if (not(new_dialog "CHECKING" dcl_id)) (progn (alert "CHECKING.DCL file could not be loaded!") (exit) ) (progn (action_tile "accept" "(saveVars)(done_dialog 2)") (action_tile "cancel" "(done_dialog 1)") (setq ddiag(start_dialog)) (unload_dialog dcl_id) (if(= ddiag 1) (princ "\n END") ) (if(= ddiag 2) (progn (setq IT(+ Im (* 2.87 Is))) (setq moment(/ (* wp tw L L) 8000)) (setq stress(/ (* moment cm) Im)) (setq stressratio(/ stress Fbm)) (setq deflection(/ (* 5 wp tw L L L L) (* 384000 69600 IT))) (setq allowdeflection(/ L 175)) (setq defratio(/ deflection allowdeflection)) (setq pt1 (getpoint)) (setq pt2 (getpoint)) (command "_mtext" pt1 pt2 "\n Actual Bending Stress =" (rtos stress 2 2) "\n Allowable Bending Stress =" (rtos Fbm 2 2) "\n Stress Ratio =" (rtos stressratio 2 2) "\n Actual Deflection =" (rtos deflection 2 2) "\n Allowable Deflection =" (rtos allowdeflection 2 2) "\n Deflection Ratio =" (rtos defratio 2 2) "" ) ) ) ) ) ) ) ) One more thing. About the mtext output. The output is this. Numerical results always appear on the next line. and I want the result to be like this with units as text (MPa, mm, etc) Does someone has a thing about this? Thank you in advance. :)
-
I had a conversation with a fellow CAD operator a few months ago and came across a question. Is it possible to create a DCL file that utilizes custom sprites as clickable entities? The idea is that the DCL window would show a dozen or so slide images and the user would click on the desired image to trigger the next part of the code. I know that I could show the images and place radio buttons next to them, but I feel that this could be a bit clunky. Any thoughts?
-
Hello everyone, I’ve dove head first into the overwhelming world of Autolisp… and needless to say I’m in way over my head. I’ve been trying to put together a program for AutoCAD 14 with a dialog box that will allow the user to pick from a drop down list of standard materials/click a “select objects” button… apply selected material to 3D solids and have it display the weight based on the volume of the solid/s. Furthermore, I have added two radio buttons: one for imperial measurement and one for metric measurement. There is also another “select objects” Total button to calculate and display the combined weight of the entire 3D solid assembly. I used a program called ObjectDCL to design the dialog box (ODC file and image attached). But that’s really as far as I got. I found these links as a starting point but couldn’t figure out how to tie it all together: http://www.ellenfinkelstein.com/acadblog/create-a-custom-function-in-autocads-calculator/ http://cadtips.cadalyst.com/mass-properties/tip-2258-calculate-weight http://cadtips.cadalyst.com/mass-properties/tip-2258-calculate-weight http://www.cadtutor.net/forum/showthread.php?50384-Calculating-weight-of-2d-shape-amp-3dsolid-object-by-asigned-material&highlight=material+density http://www.cadtutor.net/forum/showthread.php?89753-Help-please-need-to-combine-to-lisp&highlight=material+density I have the list of materials ready to insert along with the densities in lbs/in^3 I’m hoping one of you programming geniuses could please put it together to get it working as it is intended. I’m also hoping that I could then study that code and get some clue as to how it all works. I'm intrigued by the potential of this programming language and would love to be introduced to it by one of the many experts on this forum. Thanks in advance and please let me know if I missed anything. Matwt.lsp ODC.zip
-
Hello again Masters and Legends, I'm currently learning DCL right now thru Afralisp.net and some autodesk forum topics. From their examples, a DCL file is paired with a LSP file to work. For example, I have a DCL and its pair LSP file, its function is just to collect names, some numbers, places, (and any other data). Is it possible that any other LSP routine can use the data stored/inputted on the DCL? If it is, how? I just dont know. Thanks again. more power!
-
strange result with DCL external values from multiple txt files
Apache2k posted a topic in AutoLISP, Visual LISP & DCL
I know how to do this and have done it. BUT. I have multiple products.ini, products2.ini files where i get the values for popup_list. The first selected is ok. However when i change to the external ini file to the next ini file. The content of the popup_list is still the one i have used at first. I cant post the whole lisp nor DCL but has someone experienced this before and how can i "flush" the old external ini values? Thanks.- 11 replies
-
- external file
- dcl
-
(and 1 more)
Tagged with:
-
Hi, I was working with a DCL and Lisp a few days and got some doubts: 1 - radio_button: 1.1 - Has there a way to check between a number "x" of radio_button, which is the currently radio_button selected? 1.2 - To run the code and to select a first item, I use on DCL file, as enabled: is_enabled = true (it only put a dot on that item, but not select it as a click over there, in other words, only show a dot image). On lisp code I wrote to try to execute a action: (set_tile "rb1" 1), but not works, in the same way not as a click over there. 2 - toggle_button. 2.1 - The toggle button has a possibility to do a action_tile when it is pressed a first time (before to be selected), to "deselect" it is there a whay to do one action? eg.: when I select the toggle, I show one image, but when I deselect it, the image need to be changed, is there how to do it? Thanks in advance to any help!...
- 15 replies
-
- radio_button
- lisp.
-
(and 2 more)
Tagged with: