danyra Posted December 16, 2019 Posted December 16, 2019 (edited) I have this points with his line: (setq p1 (getpoint "\nPunto Inicial:")) (setq p2 (polar p1 0 0.5)) (entmakex (list '(0 . "line") (cons 10 p1) (cons 11 p2) '(62 . 2))) How can I make dimensions of this? with the same caracteristics of the image below Thanks for help. Edited December 16, 2019 by danyra Quote
Lee Mac Posted December 16, 2019 Posted December 16, 2019 (edited) Perhaps the easiest way to create the dimension would be something like: (defun c:test ( / ln p1 p2 ) (if (setq p1 (getpoint "\nPunto inicial: ")) (progn (setq p2 (mapcar '+ p1 '(0.5 0 0)) ln (entmakex (list '(0 . "LINE") (cons 10 (trans p1 1 0)) (cons 11 (trans p2 1 0)) '(62 . 2))) ) (command "_.dimlinear" "" (list ln p1) "_non" (mapcar '+ p1 '(0 -0.5 0))) ) ) (princ) ) This approach also has the advantage of creating an associative dimension. The appearance and measurement formatting should be controlled by your Dimension Style. Edited December 16, 2019 by Lee Mac 1 1 Quote
danyra Posted December 16, 2019 Author Posted December 16, 2019 (edited) 6 hours ago, Lee Mac said: (if (setq p1 (getpoint "\nPunto inicial: ")) (progn (setq p2 (mapcar '+ p1 '(0.5 0 0)) ln (entmakex (list '(0 . "LINE") (cons 10 (trans p1 1 0)) (cons 11 (trans p2 1 0)) '(62 . 2))) ) (command "_.dimlinear" "" (list ln p1) "_non" (mapcar '+ p1 '(0 -0.5 0))) ) ) (princ) But if the line is a variable, it will not always measure 0.5. How would it be in that case? Because this variable will be written by the user with this: (setq l1 (getreal "\nLongitud de Apoyo:")) Its not a number exactly. Its a variable.... I dont want that make a line also. Just the dimension, because I already have the line drawed. thanks for your help again @Lee Mac Edited December 17, 2019 by danyra Quote
BIGAL Posted December 17, 2019 Posted December 17, 2019 Here is another example. ; simple draw a box and dimension it ; By Alan H March 2019 ' info@alanh.com.au (defun ah:box ( / pt1 pt2 pt3 ahl ahh ahoff ) (setq oldsnap (getvar 'osmode)) (setq oldang (getvar 'angdir)) (setq pt1 (getpoint "\nPick lower left")) (setvar 'osmode 0) (if (not AH:getvalsm)(load "Multi Getvals.lsp")) (setq ans (AH:getvalsm (list "Simple rectang" "Enter length" 8 7 "1" "Enter height " 8 7 "2"))) (setq ahL (atof (nth 0 ans))) (setq ahH (atof (nth 1 ans))) (setq pt2 (polar pt1 0.0 ahl)) (setq pt3 (polar pt2 (/ pi 2.0) ahH)) (command "rectang" pt1 pt3) (setq ahoff (* 2.0 (* (getvar 'dimasz)(getvar 'dimscale)))) ; change offset as required (setq pt4 (polar pt2 (* pi 1.5) ahoff)) (command "dim" "hor" pt1 pt2 pt4 "" "exit") (setq pt4 (polar pt3 0.0 ahoff)) (command "dim" "Ver" pt2 pt3 pt4 "" "exit") (setvar 'osmode oldsnap) ) (ah:box) uses a dcl for input 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.