Originally Posted by
feargt
Hi GHarvey,
Thanks for your help. This works in principle although there appears to be a little problem in that each block rotates what appears to be an extra 90 degrees.....any ideas?
My code assumes that the arrow block points in the same direction as its rotation value; that is, insert it at zero rotation and it will point to the right. I guess that your block points 90 degrees from this. If this is the case, the following should fix the issue.
Code:
(defun c:pointat ( / ARRW-N ARRWS N N-PT NUM PTA)
(vl-load-com)
(if (setq arrws (ssget '((0 . "INSERT")))
); setq
(progn
(setq num (sslength arrws)
pta (getpoint "\nPick the Target... ")
n 0
); setq
(while (< n num)
(setq arrw-n (vlax-ename->vla-object (ssname arrws n))
n-pt (vlax-get arrw-n 'insertionpoint)
n (1+ n)
); setq
(vla-put-rotation arrw-n (- (angle n-pt pta) (/ pi 2.0)))
); while
); progn
(prompt "\nNo blocks selected. ")
); if
(princ)
); defun