Leaderboard
Popular Content
Showing content with the highest reputation on 08/26/2020 in all areas
-
Wasn't that recommended in the first reply to your thread?1 point
-
1 point
-
did notice a little flaw in (apply '+ (vl-string->list method so here is a better one : ; Gile (defun a2i (s / i) (if (= 0 (setq i (strlen s))) 0 (+ (* (- (ascii (strcase (substr s 1 1))) 64) (expt 26 (1- i)))(a2i (substr s 2))))) (defun sort (l / s)(append (vl-sort (vl-remove-if-not 'distof l) '(lambda (a b)(> (atoi a)(atoi b))))(mapcar '(lambda (x) (nth x s))(vl-sort-i (mapcar '(lambda (y)(a2i y))(setq s (vl-remove-if 'distof l))) '(lambda (a b)(> a b)))))) output should now be correct (sort '("A" "AA" "AB" "BD" "AZ" "ZZ" "ZZZ" "11" "10" "9" "2" "1" "0" "Z" "X" "D" "C" "B")) ("11" "10" "9" "2" "1" "0" "ZZZ" "ZZ" "BD" "AZ" "AB" "AA" "Z" "X" "D" "C" "B" "A")1 point
-
Very nice. 180 and 270 degrees don't quite line up on the axis (about 1 degree off) but that is being mega picky of me!1 point
-
Very nice add your name or http link take credit for a big effort. This may be useful also ;************************************************************************************** ; VECTORIZE - Command to convert AutoCAD objects into 'lsp' functions to simplify * ; ========= the placement of vector images within DCL image tiles and buttons. * ; * ; created by Richard Willis, (aka 'Didge', find me at 'www.theswamp.org') *1 point
-
Here, I think I managed this... (defun c:DCL-Test ( / dcl des dch valor r g c ) ;;Source : https://www.cadtutor.net/forum/topic/71064-im-being-naive-vectors-image/ ;;Arrows animated by Marko Ribar, d.i.a. (architect) ;;25.08.2020. (setq r "45" g "135" c "315") (if (and (setq dcl (vl-filename-mktemp nil nil ".dcl")) (setq des (open dcl "w")) (foreach str '( "butt04 : button { width = 15; fixed_width = true; alignment = centered; height = 2.5; fixed_height = true; }" "test : dialog" "{" " label = \"Teste\";" " spacer_1;" " : text { label = \"DCL image animation\"; alignment = left; }" " spacer;" " : boxed_column { label = \"Options arrows\";" " : row {" " : boxed_column { label = \"Arrows Angles\";" " : row { : edit_box {edit_width = 5.0; edit_limit = 5.0; fixed_width = true; label = \"Angle Red \"; key = \"Arrow01\"; mnemonic = \"R\"; } }" " : row { : edit_box {edit_width = 5.0; edit_limit = 5.0; fixed_width = true; label = \"Angle Green\"; key = \"Arrow02\"; mnemonic = \"G\"; } }" " : row { : edit_box {edit_width = 5.0; edit_limit = 5.0; fixed_width = true; label = \"Angle Cyan\"; key = \"Arrow03\"; mnemonic = \"C\"; } }" " spacer; }" " : boxed_column" " {" " label = \"Preview\";" " : row { : image_button { key = \"Img_arrows\"; width = 38; height = 17; fixed_width = true; fixed_height = true; alignment = centered; color = dialog_background; } }" " spacer;" " }" " } }" " ok_cancel;" "}" ) (write-line str des) ) (not (setq des (close des))) (> (setq dch (load_dialog dcl)) 0) (new_dialog "test" dch) ) (progn (mapcar 'set_tile '("Arrow01" "Arrow02" "Arrow03") (list r g c)) (action_tile "Arrow01" "(vectors_refresh \"Img_arrows\" r g c) (vectors \"Img_arrows\" (setq r $value) g c)") (action_tile "Arrow02" "(vectors_refresh \"Img_arrows\" r g c) (vectors \"Img_arrows\" r (setq g $value) c)") (action_tile "Arrow03" "(vectors_refresh \"Img_arrows\" r g c) (vectors \"Img_arrows\" r g (setq c $value))") (action_tile "Accept" "(done_dialog 1)") (action_tile "Cancel" "(done_dialog 0)") (vectors "Img_arrows" r g c) (setq valor (start_dialog)) ) ) (setq dch (unload_dialog dch)) (vl-file-delete dcl) (list valor r g c) ) (defun vectors_refresh ( key r g c / d o da ro ro1 ro2 go go1 go2 co co1 co2 ) (setq r (atof r) g (atof g) c (atof c)) (setq d (sqrt (+ (expt 50 2) (expt 50 2)))) (setq o (list 113 114)) (setq da 10) (setq ro (polar '(0 0) (cvunit r "degree" "radian") d)) (setq ro1 (polar ro (cvunit (+ r 150) "degree" "radian") da)) (setq ro2 (polar ro (cvunit (+ r 210) "degree" "radian") da)) (setq ro (list (car ro) (- (cadr ro)))) (setq ro1 (list (car ro1) (- (cadr ro1)))) (setq ro2 (list (car ro2) (- (cadr ro2)))) (setq go (polar '(0 0) (cvunit g "degree" "radian") d)) (setq go1 (polar go (cvunit (+ g 150) "degree" "radian") da)) (setq go2 (polar go (cvunit (+ g 210) "degree" "radian") da)) (setq go (list (car go) (- (cadr go)))) (setq go1 (list (car go1) (- (cadr go1)))) (setq go2 (list (car go2) (- (cadr go2)))) (setq co (polar '(0 0) (cvunit c "degree" "radian") d)) (setq co1 (polar co (cvunit (+ c 150) "degree" "radian") da)) (setq co2 (polar co (cvunit (+ c 210) "degree" "radian") da)) (setq co (list (car co) (- (cadr co)))) (setq co1 (list (car co1) (- (cadr co1)))) (setq co2 (list (car co2) (- (cadr co2)))) (mapcar 'set '(ro ro1 ro2 go go1 go2 co co1 co2) (list (mapcar '+ o ro) (mapcar '+ o ro1) (mapcar '+ o ro2) (mapcar '+ o go) (mapcar '+ o go1) (mapcar '+ o go2) (mapcar '+ o co) (mapcar '+ o co1) (mapcar '+ o co2))) (start_image key) (mapcar 'vector_image; Color 4 (list (fix (car co)) (fix (car co)) (car o)) (list (fix (cadr co)) (fix (cadr co)) (cadr o)) (list (fix (car co1)) (fix (car co2)) (fix (car co))) (list (fix (cadr co1)) (fix (cadr co2)) (fix (cadr co))) (list -15 -15 -15) );mapcar (mapcar 'vector_image; Color 3 (list (fix (car go)) (fix (car go)) (car o)) (list (fix (cadr go)) (fix (cadr go)) (cadr o)) (list (fix (car go1)) (fix (car go2)) (fix (car go))) (list (fix (cadr go1)) (fix (cadr go2)) (fix (cadr go))) (list -15 -15 -15) );mapcar (mapcar 'vector_image; Color 1 (list (fix (car ro)) (fix (car ro)) (car o)) (list (fix (cadr ro)) (fix (cadr ro)) (cadr o)) (list (fix (car ro1)) (fix (car ro2)) (fix (car ro))) (list (fix (cadr ro1)) (fix (cadr ro2)) (fix (cadr ro))) (list -15 -15 -15) );mapcar (end_image) );defun (defun vectors ( key r g c / d o da ro ro1 ro2 go go1 go2 co co1 co2 ) (setq r (atof r) g (atof g) c (atof c)) (setq d (sqrt (+ (expt 50 2) (expt 50 2)))) (setq o (list 113 114)) (setq da 10) (setq ro (polar '(0 0) (cvunit r "degree" "radian") d)) (setq ro1 (polar ro (cvunit (+ r 150) "degree" "radian") da)) (setq ro2 (polar ro (cvunit (+ r 210) "degree" "radian") da)) (setq ro (list (car ro) (- (cadr ro)))) (setq ro1 (list (car ro1) (- (cadr ro1)))) (setq ro2 (list (car ro2) (- (cadr ro2)))) (setq go (polar '(0 0) (cvunit g "degree" "radian") d)) (setq go1 (polar go (cvunit (+ g 150) "degree" "radian") da)) (setq go2 (polar go (cvunit (+ g 210) "degree" "radian") da)) (setq go (list (car go) (- (cadr go)))) (setq go1 (list (car go1) (- (cadr go1)))) (setq go2 (list (car go2) (- (cadr go2)))) (setq co (polar '(0 0) (cvunit c "degree" "radian") d)) (setq co1 (polar co (cvunit (+ c 150) "degree" "radian") da)) (setq co2 (polar co (cvunit (+ c 210) "degree" "radian") da)) (setq co (list (car co) (- (cadr co)))) (setq co1 (list (car co1) (- (cadr co1)))) (setq co2 (list (car co2) (- (cadr co2)))) (mapcar 'set '(ro ro1 ro2 go go1 go2 co co1 co2) (list (mapcar '+ o ro) (mapcar '+ o ro1) (mapcar '+ o ro2) (mapcar '+ o go) (mapcar '+ o go1) (mapcar '+ o go2) (mapcar '+ o co) (mapcar '+ o co1) (mapcar '+ o co2))) (start_image key) (mapcar 'vector_image; Color 4 (list (fix (car co)) (fix (car co)) (car o)) (list (fix (cadr co)) (fix (cadr co)) (cadr o)) (list (fix (car co1)) (fix (car co2)) (fix (car co))) (list (fix (cadr co1)) (fix (cadr co2)) (fix (cadr co))) (list 4 4 4) );mapcar (mapcar 'vector_image; Color 3 (list (fix (car go)) (fix (car go)) (car o)) (list (fix (cadr go)) (fix (cadr go)) (cadr o)) (list (fix (car go1)) (fix (car go2)) (fix (car go))) (list (fix (cadr go1)) (fix (cadr go2)) (fix (cadr go))) (list 3 3 3) );mapcar (mapcar 'vector_image; Color 1 (list (fix (car ro)) (fix (car ro)) (car o)) (list (fix (cadr ro)) (fix (cadr ro)) (cadr o)) (list (fix (car ro1)) (fix (car ro2)) (fix (car ro))) (list (fix (cadr ro1)) (fix (cadr ro2)) (fix (cadr ro))) (list 1 1 1) );mapcar (mapcar 'vector_image; Color 8 (list 207 204 202 202 203 203 204 207 209 208 208 210 120 119 119 115 115 117 120 122 120 16 113) (list 107 103 103 103 112 112 112 109 112 108 108 103 22 26 22 17 17 17 21 17 22 114 17) (list 210 207 204 206 206 204 207 209 211 211 211 211 120 120 119 119 117 120 122 124 124 211 113) (list 103 107 103 108 108 112 109 112 112 112 103 103 26 26 26 22 17 21 17 17 17 114 212) (list 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8) );mapcar (end_image) );defun1 point
-
If you have recently updated your AutoCAD it is possible that the windows file association is broken. Right click on a drawing and choose "Open With" from the drop down list and ensure it is set correctly.1 point