duke Posted May 4 Posted May 4 Hello again friends ‼‼ I attach an explanatory image. I would like to place a text (a green number 2 in the image) at a certain distance from the vertex of the Poly. If the Azimuth of both lines are known, through a Routine, how do I find out the Average Azimuth of those 2 Lines, to be able to position the green text 2 at a certain distance from the vertex Thanks in advance friends ‼‼‼‼ Quote
tombu Posted May 4 Posted May 4 Easiest to code would include picking the vertex and the two endpoints. For bisecting using lines and polylines see: http://www.cadtutor.net/forum/showthread.php?100709-Draw-bisector-line&p=684958&viewfull=1#post684958 1 Quote
duke Posted May 4 Author Posted May 4 Hello tombu, thanks for responding ‼‼ Do you think you can help me with a simpler code that can only get the average Azimuth That Routine that you told me does not give the average Azimuth in text, what it does is create lines and it is a level of programming that I still do not know how to understand, or make modifications to it myself, or even understand it, ha ha ha Real apologies friend. And thanks in advance ‼‼‼ Quote
tombu Posted May 4 Posted May 4 Just pointing out how complex the code could be when you could simply use snap from the vertex to midpoint between those two endpoints for the direction. AutoCAD - Snap From - https://www.google.com/search?q=autocad+snap+from&rlz=1C1RXQR_enUS986US986&oq=autocad+snap+from&gs_lcrp=EgZjaHJvbWUqBwgAEAAYgAQyBwgAEAAYgAQyCAgBEAAYFhgeMggIAhAAGBYYHjIICAMQABgWGB4yCAgEEAAYFhgeMggIBRAAGBYYHjIICAYQABgWGB4yCAgHEAAYFhgeMggICBAAGBYYHjIICAkQABgWGB7SAQkxMjUxMWowajeoAgCwAgA&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:15476a18,vid:gbWQ8Gh0r9Q,st:0 1 Quote
duke Posted May 4 Author Posted May 4 3 hours ago, tombu said: Just pointing out how complex the code could be when you could simply use snap from the vertex to midpoint between those two endpoints for the direction. AutoCAD - Snap From - https://www.google.com/search?q=autocad+snap+from&rlz=1C1RXQR_enUS986US986&oq=autocad+snap+from&gs_lcrp=EgZjaHJvbWUqBwgAEAAYgAQyBwgAEAAYgAQyCAgBEAAYFhgeMggIAhAAGBYYHjIICAMQABgWGB4yCAgEEAAYFhgeMggIBRAAGBYYHjIICAYQABgWGB4yCAgHEAAYFhgeMggICBAAGBYYHjIICAkQABgWGB7SAQkxMjUxMWowajeoAgCwAgA&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:15476a18,vid:gbWQ8Gh0r9Q,st:0 Hello, thanks for the new recommendation, it really looks interesting and it seems that it can do what I want. The only thing left for me is to figure out how to translate that command into Lisp code Quote
duke Posted May 5 Author Posted May 5 11 hours ago, tombu said: Just pointing out how complex the code could be when you could simply use snap from the vertex to midpoint between those two endpoints for the direction. AutoCAD - Snap From - https://www.google.com/search?q=autocad+snap+from&rlz=1C1RXQR_enUS986US986&oq=autocad+snap+from&gs_lcrp=EgZjaHJvbWUqBwgAEAAYgAQyBwgAEAAYgAQyCAgBEAAYFhgeMggIAhAAGBYYHjIICAMQABgWGB4yCAgEEAAYFhgeMggIBRAAGBYYHjIICAYQABgWGB4yCAgHEAAYFhgeMggICBAAGBYYHjIICAkQABgWGB7SAQkxMjUxMWowajeoAgCwAgA&sourceid=chrome&ie=UTF-8#fpstate=ive&vld=cid:15476a18,vid:gbWQ8Gh0r9Q,st:0 hi bro, i am trying and not always the object move inside the pline how can i get it pls ? thanks ! Quote
BIGAL Posted May 6 Posted May 6 Try this ; Put number at 1/2 internal angle ; By AlanH May 2024 (defun c:labmid ( / oldsnap dist p1 p2 p3 p4 ang1 ang2 ang3) (setq x 1) ;; Get Inside Angle - Lee Mac ;; Returns the smaller angle subtended by three points with vertex at p2 (defun LM:GetInsideAngle ( p1 p2 p3 ) ( (lambda ( a ) (min a (- (+ pi pi) a))) (rem (+ pi pi (- (angle p2 p1) (angle p2 p3))) (+ pi pi)) ) ) ; clockwise check by G Carlo (defun gc:clockwise-p ( p1 p2 p3 ) (< (sin (- (angle p1 p3) (angle p1 p2))) -1e-14)) (setq oldsnap (getvar 'osmode)) (setq dist (getreal "\nEnter radial distance from corner ")) (setvar 'osmode 35) (while (setq p1 (getpoint "\nPick 1st point away from intersection Enter to exit ")) (setvar 'osmode 32) (setq p2 (getpoint "\nPick point at intersection ")) (setvar 'osmode 35) (setq p3 (getpoint "\nPick 3rd point away from intersection ")) (setq ang3 (/ (LM:GetInsideAngle p1 p2 p3 ) 2.0)) (setq ang1 (angle p1 p2)) (if (gc:clockwise-p p1 p2 p3 ) (setq p4 (polar p2 (+ ang1 ang3 pi) dist)) (setq p4 (polar p2 (- ang1 ang3 pi) dist)) ) (setvar 'osmode 0) (command "text" p4 1.0 0.0 (rtos X 2 0)) (setq x (1+ x)) (setvar 'osmode 35) ) (setvar 'osmode oldsnap) (princ) ) (c:labmid) 1 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.