Jump to content

Recommended Posts

Posted

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

q23.JPG

Posted

Hint - read the docs:

 

polar

ac.right.gif

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.

Posted

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

Posted

Thank you very much my virtual tutors

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...