Qonfire Posted February 7, 2012 Posted February 7, 2012 Guys I dont get why my object which is being copied at specific distance and polar angle is copied at the wrong spot. Object snap off. (vl-load-com) (defun rtd (a) ; Radians to Degrees (/ (* a 180.0) pi) ) (Setq pt3 (getcorner (setq pt1 (getpoint "\norigin")) "n\corner")) (setq pt4 (list (car pt1) (cadr pt3))) (setq pt2 (list (car pt3) (cadr pt1))) (command "Line" pt1 pt2 pt3 pt4 "c") (setq insrtpt (list (+ (car pt1) 10) (- (cadr pt1) 10))) (command "._-insert" "Q-SPRK-TYPE4" insrtpt "" "" "" ) (setq primo (ssget "L")) (setq ang (rtd (angle pt1 pt4))) ;;;;;;;[color="red"];;;;;;;270.0[/color] (command "_copy" primo "" insrtpt (polar insrtpt ang 180)) ;;;;;copies at around 10 degree angle Quote
Lee Mac Posted February 7, 2012 Posted February 7, 2012 Hint - read the docs: polar Returns the UCS 3D point at a specified angle and distance from a point (polar pt ang dist) Arguments: pt A 2D or 3D point. ang An angle expressed in radians relative to the world X axis. Angles increase in the counterclockwise direction, independent of the current construction plane. dist Distance from the specified pt. Quote
MSasu Posted February 7, 2012 Posted February 7, 2012 Please pay attention that the ANGLE function return in radians, so there is no need to convert that value prior to pass it to POLAR. Regards, Mircea Quote
Qonfire Posted February 7, 2012 Author Posted February 7, 2012 Thank you very much my virtual tutors 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.