johnpieter Posted April 15, 2011 Posted April 15, 2011 how to place the line with angle using code.actually i want to place the line with 15Degrees.Please see the picture. like Command: l LINE Specify first point: Specify next point or [undo]: @250 Command: l LINE Specify first point: Specify next point or [undo]: @250 Quote
MSasu Posted April 15, 2011 Posted April 15, 2011 (edited) Please take a look to POLAR function; take care that accept angle in radians as argument. (command "_LINE" MyFirstPoint (polar MyFirstPoint theAngle theLength) "") Regards, Mircea Edited April 15, 2011 by MSasu spelling Quote
johnpieter Posted April 15, 2011 Author Posted April 15, 2011 msasu tried.but no working..currently i am using (defun c:1 () (command "_Line" Pause "@1500 (princ)) (defun c:2 () (command "_Line" Pause "@1500 (princ)) Quote
MSasu Posted April 15, 2011 Posted April 15, 2011 You can achive the same result by using the code below - please feel free to adjust this example to suit your needs. (setq OldOsmode (getvar "OSMODE")) (setq thePoint (getpoint "\nInsertion point: ")) (setvar "OSMODE" 0) (command "_LINE" thePoint (polar thePoint (* (/ 15 180.0) pi) 1500.0) "") (command "_LINE" thePoint (polar thePoint (* (/ 75 180.0) pi) 1500.0) "") (setvar "OSMODE" OldOsmode) Regards, Mircea 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.