Grrr Posted February 1, 2018 Posted February 1, 2018 Hey guys, I'm trying to rotate an object by using 3 points and I'm wondering could you solve this problem - ; Rotate Reference Test (defun C:test ( / o bp sp dp ) (and (setq o (car (entsel "\nSelect object to rotate: "))) (setq o (vlax-ename->vla-object o)) (setq bp (getpoint "\nSpecify base point for rotation: ")) (setq sp (getpoint "\nSpecify source point: " bp)) (not (grdraw bp sp 2 1)) (setq dp (getpoint "\nSpecify dest point: " bp)) ; (vlax-invoke o 'Rotate ..?) ) (princ) ) Quote
Lee Mac Posted February 1, 2018 Posted February 1, 2018 ; Rotate Reference Test (defun C:test ( / o bp sp dp ) (and (setq o (car (entsel "\nSelect object to rotate: "))) (setq o (vlax-ename->vla-object o)) (setq bp (getpoint "\nSpecify base point for rotation: ")) (setq sp (getpoint "\nSpecify source point: " bp)) (not (grdraw bp sp 2 1)) (setq dp (getpoint "\nSpecify dest point: " bp)) (vla-Rotate o (vlax-3D-point bp) (- (angle bp dp) (angle bp sp))) ) (princ) ) Quote
Grrr Posted February 1, 2018 Author Posted February 1, 2018 Thanks Lee! I was trying to simulate align, by having 4 points which define 2 segments and an object to be moved and rotated. Now it works! Quote
Lee Mac Posted February 1, 2018 Posted February 1, 2018 You're welcome! This option is already available as part of the standard ROTATE command however... Command: rotate Current positive angle in UCS: ANGDIR=counterclockwise ANGBASE=0 Select objects: 1 found Specify base point: Specify rotation angle or [Copy/[color=red]Reference[/color]] <0>: Quote
Grrr Posted February 1, 2018 Author Posted February 1, 2018 Yes, I know - I'm just trying to switch some command calls to activex (revising old routines). Quote
Roy_043 Posted February 2, 2018 Posted February 2, 2018 Just a hint: The base point for the Rotate method is expressed in the WCS. 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.