AeJay Posted April 27, 2023 Share Posted April 27, 2023 (edited) I currently have been using this code: (defun c:DLA ( / sel ent txp al ar mp uALR s txpp uvt tp exss exssent exssl exssindex) (defun deg2rad (ang / ) (/ (* PI ang) 180.0) ) (defun rad2deg ( ang / ) (/ (* 180.0 ang) PI) ) ;; midpoint of 2 given points (defun mid ( pt1 pt2 / ) (mapcar '(lambda (x y) (+ (* 0.5 x) (* 0.5 y))) pt1 pt2 ) ) ;;; Calculate unit vector of vector a (defun uvec (a / d) (setq d (distance '(0 0 0) a) a (mapcar '/ a (list d d d)) ) ) ; Compute the dot product of 2 vectors a and b (defun dot ( a b / dd) (setq dd (mapcar '* a b)) (setq dd (+ (nth 0 dd) (nth 1 dd) (nth 2 dd))) ) ;end of dot (princ "\nInput Desired Distance: ") (setq dist (getreal)) (princ "\nSelect Dimension(s) To Change: ") (setq exss (ssget '((0 . "*dim*")))) (setq exssl (sslength exss)) (setq exssindex 0) (repeat exssl (setq exssent (entget (ssname exss exssindex))) (setq ent (cdr (car exssent))) (setq txp (cdr (assoc 10 (entget ent)))) (setq al (cdr (assoc 13 (entget ent)))) (setq ar (cdr (assoc 14 (entget ent)))) (setq mp (mapcar '/ (mapcar '+ al ar) '(2. 2. 2.) ) ) ; uALR = unit vector from al to ar (setq uALR (uvec (mapcar '- ar al))) (setq s (dot uALR (mapcar '- txp al))) ; txpp = projection of txp onto the line (setq txpp (mapcar '+ al (mapcar '* uALR (list s s s))) ) (setq uvt (uvec (mapcar '- txp txpp))) (setq tp (mapcar '+ mp (mapcar '* uvt (list dist dist dist)))) (entmod (subst (cons 10 tp) (assoc 10 (entget ent)) (entget ent)) ) (entmod (subst (cons 11 tp) (assoc 11 (entget ent)) (entget ent)) ) (setq exssindex (+ exssindex 1)) ) (princ) ) However, this somehow messes up when there are selected dimension lines that are not level with each other. Please see the attached images. Before: During usage of DLA: Actual Output: As you can see the dim lines with value of 511 are not inline with the 200mm distanced dimension lines of 464. Desired Output: should be the image below where you can see the the 464 dim lines are at 200mm. Is there a way that after the "select objects" prompt that there will be a "select base point" prompt which will be the basis to adjust all dim lines to the inputted distance. Or as long as there is a way to achieve the desired output. sample.dwg Edited April 27, 2023 by AeJay Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted April 27, 2023 Share Posted April 27, 2023 Do you know for QDIM command? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted April 27, 2023 Share Posted April 27, 2023 (edited) Ok I am sure already suggested this somewhere. I do not plan on fixing the dims rather just make them what you want 1st go. This is vertical dim to the right 200 offset from the 2nd pick point. NOTE 2ND point. (defun c:dr200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "ver" pt1 pt2 (mapcar '+ pt2 (list 200.0 0.0 0.0)) "" "exit") ) (princ) ) You want to learn lisp so your task is, the extra defuns, Left, top and bottom the last 2 are hor dims, a hint. Look at "list" in code (list X Y Z) for offsets. dl200 db200 dt200 Edited April 27, 2023 by BIGAL 1 Quote Link to comment Share on other sites More sharing options...
AeJay Posted April 28, 2023 Author Share Posted April 28, 2023 (edited) 12 hours ago, marko_ribar said: Do you know for QDIM command? I am not familiar with that command 1 hour ago, BIGAL said: Ok I am sure already suggested this somewhere. I do not plan on fixing the dims rather just make them what you want 1st go. This is vertical dim to the right 200 offset from the 2nd pick point. NOTE 2ND point. (defun c:dr200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "ver" pt1 pt2 (mapcar '+ pt2 (list 200.0 0.0 0.0)) "" "exit") ) (princ) ) You want to learn lisp so your task is, the extra defuns, Left, top and bottom the last 2 are hor dims, a hint. Look at "list" in code (list X Y Z) for offsets. dl200 db200 dt200 Thanks for the clues, I got it (defun c:dr200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "ver" pt1 pt2 (mapcar '+ pt2 (list 200.0 0.0 0.0)) "" "exit") ) (princ) ) (defun c:dl200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "ver" pt1 pt2 (mapcar '+ pt2 (list -200.0 0.0 0.0)) "" "exit") ) (princ) ) (defun c:dt200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "hor" pt1 pt2 (mapcar '+ pt2 (list 0.0 200.0 0.0)) "" "exit") ) (princ) ) (defun c:db200 ( / pt1 pt2) (while (setq pt1 (getpoint "\nPick 1st point ")) (setq pt2 (getpoint "\nPick point 2 ")) (command "dim" "hor" pt1 pt2 (mapcar '+ pt2 (list 0.0 -200.0 0.0)) "" "exit") ) (princ) ) Questions: 1. Is there a way to make this command dynamic by asking user to select with mouse which direction (top, bot, left, right)? 2. Is there really a way to make this code be an adjustment type of tool, like what I mentioned in this thread? Edited April 28, 2023 by AeJay Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted April 28, 2023 Share Posted April 28, 2023 If you don't need the dimensions to be at that specific spot, I've already released the program Align To Direction that can align the dimensions to any direction you wish. But if not, I can probably adjust the program to suit. In response to your question 1, have a look at using initget and getkword, this will give you a good start. 1 Quote Link to comment Share on other sites More sharing options...
AeJay Posted April 28, 2023 Author Share Posted April 28, 2023 1 hour ago, Jonathan Handojo said: If you don't need the dimensions to be at that specific spot, I've already released the program Align To Direction that can align the dimensions to any direction you wish. But if not, I can probably adjust the program to suit. In response to your question 1, have a look at using initget and getkword, this will give you a good start. Thanks! I didn't even notice that there were a list of other programs in https://www.cadtutor.net/forum/files/category/1-programs-and-scripts/ if you didn't link your program, great! Is it possible to make a variation that would allow the user to select dim line(s) then still have the "specify alignment direction" option but instead of having infinite elasticity in that direction, only limit it to 200mm? BTW, this was the result when I used it in the sample.dwg, somehow 3 of the other dim lines were not adjusting correctly. 1. 2. 3. 4. Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted April 28, 2023 Share Posted April 28, 2023 (edited) The ones labelled 511 and 501 are horizontal dimensions as opposed to vertical dimensions, so of course the result would be as shown in your result. It is a different case than the original post after all. As for one of the dimensions labelled 464, you have the property of the text movement set to "Move text, add leader". The program simply moves the texts, so you may want to change that to "Keep dim line with text", as shown below. With regards to the restricted distance, I will integrate your idea, much like the OFFSET command. I'll let you know when I'm done. Edited April 28, 2023 by Jonathan Handojo 1 Quote Link to comment Share on other sites More sharing options...
AeJay Posted April 28, 2023 Author Share Posted April 28, 2023 (edited) 3 hours ago, Jonathan Handojo said: The ones labelled 511 and 501 are horizontal dimensions as opposed to vertical dimensions, so of course the result would be as shown in your result. It is a different case than the original post after all. As for one of the dimensions labelled 464, you have the property of the text movement set to "Move text, add leader". The program simply moves the texts, so you may want to change that to "Keep dim line with text", as shown below. With regards to the restricted distance, I will integrate your idea, much like the OFFSET command. I'll let you know when I'm done. With regards to "The ones labelled 511 and 501 are horizontal dimensions as opposed to vertical dimensions, so of course the result would be as shown in your result. It is a different case than the original post after all." Can the current ATD function be modified for horizontal dims as well? Thanks, I will surely wait for the modified ATD for restricted distance EDIT: Can the option of allowing Osnap to work too after selecting which direction (when dim line is elastic and selecting till where to align) be possible? As is seen that I have endpoint oSnap turned on but it doesn't appear. Edited April 28, 2023 by AeJay Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted April 28, 2023 Share Posted April 28, 2023 2 hours ago, AeJay said: Can the current ATD function be modified for horizontal dims as well? Are you saying that you want the horizontal dimension to "rotate" to be a vertical dimension? If so, it's possible, but it's out of the scope of the original intention of the program. I will not modify the program to go off scope. It's purely for the intention of aligning every "point" along a direction. 2 hours ago, AeJay said: Can the option of allowing Osnap to work too after selecting which direction (when dim line is elastic and selecting till where to align) be possible? It's possible, but I opt that out since it can lag quite a lot when working with drawings containing many objects of high density. Originally it's not possible, but with Lee Mac's help, it's doable. I'll implement the distance restriction feature, and then setting a distance of 0 should work similar to snapping. 1 Quote Link to comment Share on other sites More sharing options...
AeJay Posted May 3, 2023 Author Share Posted May 3, 2023 On 4/28/2023 at 5:59 PM, Jonathan Handojo said: Are you saying that you want the horizontal dimension to "rotate" to be a vertical dimension? If so, it's possible, but it's out of the scope of the original intention of the program. I will not modify the program to go off scope. It's purely for the intention of aligning every "point" along a direction. It's possible, but I opt that out since it can lag quite a lot when working with drawings containing many objects of high density. Originally it's not possible, but with Lee Mac's help, it's doable. I'll implement the distance restriction feature, and then setting a distance of 0 should work similar to snapping. Hi Jonathan, is there an update with the distance of 0 snapping etc? Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted May 4, 2023 Share Posted May 4, 2023 On 5/3/2023 at 1:28 PM, AeJay said: Hi Jonathan, is there an update with the distance of 0 snapping etc? Just give me a moment, I'm still working on the calculations to make it as user-friendly as possible. 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 5, 2023 Share Posted May 5, 2023 (edited) Try this has the 4 directions set at 200 offset from closest point. Could do a enter offset etc. Pick points in sequence then enter. (defun c:dr200 ( / pt1 pt2 lst lst2 x j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) 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 c:dl200 ( / pt1 pt2 x lst lst2 j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) 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 c:dt200 ( / pt1 pt2 lst lst2 y j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (cadr pt1) 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 c:db200 ( / pt1 pt2 lst lst2 y x j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (cadr pt1) 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) ) Edited May 5, 2023 by BIGAL 1 Quote Link to comment Share on other sites More sharing options...
AeJay Posted May 5, 2023 Author Share Posted May 5, 2023 (edited) 2 hours ago, BIGAL said: Try this has the 4 directions set at 200 offset from closest point. Could do a enter offset etc. Pick points in sequence then enter. (defun c:dr200 ( / pt1 pt2 lst lst2 x j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) 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 c:dl200 ( / pt1 pt2 x lst lst2 j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) 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 c:dt200 ( / pt1 pt2 lst lst2 y j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (cadr pt1) 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 c:db200 ( / pt1 pt2 lst lst2 y x j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (cadr pt1) 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) ) This works great, but I don't know why there is an extra "0" tho. sample.dwg EDIT: I am also trying to make it dynamic by combining it into one d200 function, the code below allows me to pick points and all but doesn't accept DB, DT, etc. and always says invalid keyword. (defun c:d200 (/ offset pt1 lst lst2 x j direction) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence. Press Enter to stop. ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) lst2)) ) (setq x (length lst)) (setq j 0) (setq direction (getkword "\nEnter offset direction [DR/DB/DL/DT]: ")) (cond ((= direction "DR") (setq offset 200.) (setq pt3 (list (+ (car (vl-sort lst2 '>)) offset) (cadr (car lst))))) ((= direction "DB") (setq offset 200.) (setq pt3 (list (car (car lst)) (- (car (vl-sort lst2 '<)) offset)))) ((= direction "DL") (setq offset -200.) (setq pt3 (list (- (car (vl-sort lst2 '<)) offset) (cadr (car lst))))) ((= direction "DT") (setq offset -200.) (setq pt3 (list (car (car lst)) (+ (cadr (car (vl-sort lst2 '>))) offset)))) (T (princ "\nInvalid direction. Please try again.") (setq offset nil)) ) (if offset (progn (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) ) Edited May 5, 2023 by AeJay Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 5, 2023 Share Posted May 5, 2023 Ok will add L U D R and may be dimming 2 of same pt for some reason will check. 1 Quote Link to comment Share on other sites More sharing options...
Jonathan Handojo Posted May 5, 2023 Share Posted May 5, 2023 On 5/3/2023 at 1:28 PM, AeJay said: Hi Jonathan, is there an update with the distance of 0 snapping etc? This program has now been updated as version 1.3 that allows for distance prompting. 1 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 7, 2023 Share Posted May 7, 2023 Thinking about pick points work out a average angle between points so auto L R U D. Just need time. eg right is 225-315 degrees from Y axis. 1 Quote Link to comment Share on other sites More sharing options...
AeJay Posted May 8, 2023 Author Share Posted May 8, 2023 (edited) 2 hours ago, BIGAL said: Thinking about pick points work out a average angle between points so auto L R U D. Just need time. eg right is 225-315 degrees from Y axis. Great idea! Sure, will wait for this Edited May 8, 2023 by AeJay Quote Link to comment Share on other sites More sharing options...
AeJay Posted May 15, 2023 Author Share Posted May 15, 2023 On 5/5/2023 at 8:54 AM, BIGAL said: Try this has the 4 directions set at 200 offset from closest point. Could do a enter offset etc. Pick points in sequence then enter. (defun c:dr200 ( / pt1 pt2 lst lst2 x j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) 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 c:dl200 ( / pt1 pt2 x lst lst2 j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (car pt1) 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 c:dt200 ( / pt1 pt2 lst lst2 y j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (cadr pt1) 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 c:db200 ( / pt1 pt2 lst lst2 y x j) (setq oldsnap (getvar 'osmode)) (setq lst '() lst2 '()) (while (setq pt1 (getpoint "\nPick dim point in sequence Enter to stop ")) (setq lst (cons pt1 lst)) (setq lst2 (cons (cadr pt1) 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) ) Is there an update with the adjusted one for this? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 16, 2023 Share Posted May 16, 2023 I have been very busy but will try tonight. 2 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted May 18, 2023 Share Posted May 18, 2023 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) ) 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.