Guest Posted February 13, 2015 Posted February 13, 2015 Hi. I am searching for a lisp to draw vertical lines like the example of the photo. 1) select point A then select point B 2) Give the length of the first vertical line (example 6.10m) 3) Give the length of the second vertical line (example 12.00m) 4) Pick the side you want to draw this lines For my drawings i use this units format-> units -> Decimal,Grads ,Clockwise ,meters, and Direction -> North Can any one help Thanks Quote
hanhphuc Posted February 13, 2015 Posted February 13, 2015 if A to B is 100.00, how it looks like with the (input same example 6.10 & 12.00) Quote
eldon Posted February 13, 2015 Posted February 13, 2015 Do you want a lisp because you cannot draw this yourself? It seems to be a particular requirement rather than a general routine for everybody. Sometimes, drawing can mean a bit of effort, and unless you can write your own lisp, why should anyone else do so? Unless they are looking to fill up some time. Quote
Guest Posted February 13, 2015 Posted February 13, 2015 if A to B is 100.00, how it looks like with the (input same example 6.10 & 12.00) hi hanhphuc tha ab length is 8.24m in this example . The length 6.10 and 12 is only an examlpe .I want to have the option to give any length for this vertival line. Any ideas Thanks Quote
hanhphuc Posted February 13, 2015 Posted February 13, 2015 normal we do something like this @dist Command: LINE Specify first point: Specify next point or [undo]: @6.1<0 Specify next point or [undo]: Command: LINE Specify first point: Specify next point or [undo]: @12<90 EDIT: In your pic, the lines are diagonal. or the green line must be perpendicular? Quote
Guest Posted February 13, 2015 Posted February 13, 2015 (edited) hanhphuc I was thinkng a lisp using Pythagorean theorem to calculate the Intersections point of this vertical lines. 1) select point A then select point B 2) Give the length of the first vertical line (from point B example 6.10m) 3) Pick the side you want to draw this lines Edited February 25, 2015 by prodromosm Quote
BIGAL Posted February 14, 2015 Posted February 14, 2015 a/sina= b/sinb you only have 1 unknown so can solve the missing angle then go 12 units to the correct pt. Quote
Guest Posted February 25, 2015 Posted February 25, 2015 I think that Pythagorean theorem is better way because we don't know the angles a,b Quote
hanhphuc Posted February 25, 2015 Posted February 25, 2015 (edited) I think that Pythagorean theorem is better way because we don't know the angles a,b If the perpendicular line is fixed by manual input, then the line from A must be diagonal? Command: test Pick point A: Pick point B: Input perpendicular length: Pick side to draw.. This example can draw perpendicular line, but not diagonal (defun c:test (/ os asin _line p1 p2 d2 l1 ad d ok p ang d3 dir ip ) ; hanhphuc 25.02.2015 (setq os (getvar 'osmode) asin '((x) (atan (/ x (sqrt (+ 1.0 (* x (- x))))))) _line '((a lst) (foreach x lst (entmake (list '(0 . "LINE") (cons 10 a) (cons 11 x))))) ) ;_ end of setq (setvar 'osmode 1) (if (and (setq p1 (getpoint "\nPick point A: ")) (setq p2 (getpoint p1 "\nPick point B: ")) (setq d2 (getdist p2 "\nInput perpendicular length: ")) (setq l1 (list p1 p2) ad (mapcar ''((x) (apply x l1)) '(angle distance)) d (cadr ad) ok (< d2 d)) (setq p (getpoint "\nPick side to draw.. ")) ) ;_ end of and (progn (setq ang (asin (/ d2 d)) d3 (* d (cos ang)) dir (car ad) ip (apply 'if (vl-list* (minusp (- (* (- (cadr p) (cadr p1)) (cos dir)) (* (- (car p) (car p1)) (sin dir)))) (mapcar ''((f) (polar p1 ((eval f) dir ang) d3)) '(- +)) ) ;_ end of vl-list* ) ;_ end of apply ) ;_ end of setq (_line ip l1) ) ;_ end of progn (if (not ok) (alert "Perpendicular line exceeds length of A to B!") ) ) ;_ end of if (setvar 'osmode os) (princ) ) ;_ end of defun another (not related to code): by theory if diagonal length by manual input, we can't get perpendicular length (line from B) matched with manual input value due to A to B is fixed length Edited February 25, 2015 by hanhphuc osmode 1 Quote
hanhphuc Posted February 25, 2015 Posted February 25, 2015 Thank you hanhphuc huh? great! you are welcome 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.