AeJay Posted May 18, 2023 Author Share Posted May 18, 2023 (edited) 6 hours ago, BIGAL said: Try this still thinking about an auto angle approach. Make sure Multi Radio buttons.lsp is saved in a support path directory.Multi radio buttons.lsp ; https://www.cadtutor.net/forum/topic/77391-how-can-i-modify-this-code-to-allow-me-to-select-a-base-point-as-basis/ ; Dimensions a shape with a 200 offset for 4 sides Right Left Top Bottom. ; By AlanH May 2023 (defun c:dim200 ( / dr200 dl200 db200 dt200 lst ans) (defun dr200 ( / pt1 pt2 x lst2 j pt3) (setq lst2 '()) (foreach pt lst (setq lst2 (cons (cadr pt) lst2)) ) (setq X (car (vl-sort lst2 '>))) (setq pt3 (list (+ x 200.) (cadr (car lst)))) (setq x (length lst)) (setq j 0) (setvar 'osmode 0) (repeat (- x 1) (command "dim" "ver" (nth j lst) (nth (1+ j) lst) pt3 "" "exit") (setq j (1+ j)) ) (setvar 'osmode oldsnap) (princ) ) (defun dl200 ( / pt1 pt2 x lst2 j pt3) (setq lst2 '()) (foreach pt lst (setq lst2 (cons (car pt) lst2)) ) (setq X (car (vl-sort lst2 '<))) (setq pt3 (list (- x 200.) (cadr (car lst)))) (setq x (length lst)) (setq j 0) (setvar 'osmode 0) (repeat (- x 1) (command "dim" "ver" (nth j lst) (nth (1+ j) lst) pt3 "" "exit") (setq j (1+ j)) ) (setvar 'osmode oldsnap) (princ) ) (defun dt200 ( / pt1 pt2 y lst2 j pt3) (setq lst2 '()) (foreach pt lst (setq lst2 (cons (cadr pt) lst2)) ) (setq Y (car (vl-sort lst2 '>))) (setq pt3 (list (car (car lst)) (+ y 200.) )) (setq x (length lst)) (setq j 0) (setvar 'osmode 0) (repeat (- x 1) (command "dim" "hor" (nth j lst) (nth (1+ j) lst) pt3 "" "exit") (setq j (1+ j)) ) (setvar 'osmode oldsnap) (princ) ) (defun db200 ( / pt1 pt2 y lst2 j pt3) (setq lst2 '()) (foreach pt lst (setq lst2 (cons (cadr pt) lst2)) ) (setq Y (car (vl-sort lst2 '<))) (setq pt3 (list (car (car lst)) (- y 200.) )) (setq x (length lst)) (setq j 0) (setvar 'osmode 0) (repeat (- x 1) (command "dim" "hor" (nth j lst) (nth (1+ j) lst) pt3 "" "exit") (setq j (1+ j)) ) (setvar 'osmode oldsnap) (princ) ) ;;;;;;; starts here (setq oldsnap (getvar 'osmode)) (setq lst '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) ) (if (not AH:Butts)(load "Multi Radio buttons.lsp")) (setq ans (ah:butts 1 "V" '("Choose a side" "Right" "Left" "Top" "Bottom"))) (cond ((= ans "Right")(dr200)) ((= ans "Left")(dl200)) ((= ans "Top")(dt200)) ((= ans "Bottom")(db200)) ) (setvar 'osmode oldsnap) (princ) ) Tried this but somehow weird outputs especially for Right option. Output for Left: Output for Right: Output for Top: Output for Bottom: Edited May 18, 2023 by AeJay Quote Link to comment Share on other sites More sharing options...
AeJay Posted May 29, 2023 Author Share Posted May 29, 2023 Any updates on this? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 29, 2023 Share Posted May 29, 2023 Have not forgotten still on my to do list. Been busy lately. 1 Quote Link to comment Share on other sites More sharing options...
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.