lkrkck Posted September 12, 2017 Share Posted September 12, 2017 Hello, I've this code to move some AcadPoints tPerpendicular of one 2DPolyline. The problem: I've this points with Z value, when i run the code this points goes perpendicular to line but with Z=0. (defun c:SnapToObj ( / en obj pts_ss ss_len c pten ptobj pted pt pt2) (setq en (car (entsel "\nSelect Object: "))) (setq obj (vlax-ename->vla-object en)) (princ "\nSelect points: ") (setq pts_ss (ssget (list (cons 0 "POINT")))) (setq ss_len (sslength pts_ss)) (setq c 0) (while (< c ss_len) (setq pten (ssname pts_ss c)) (setq ptobj (vlax-ename->vla-object pten)) (setq pted (entget pten)) (setq pt (cdr (assoc 10 pted))) (setq pt2 (vlax-curve-getClosestPointTo obj pt)) (vla-move ptobj (vlax-3d-point pt) (vlax-3d-point pt2)) (setq c (+ c 1)) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
ronjonp Posted September 12, 2017 Share Posted September 12, 2017 Problem solved HERE. Quote Link to comment Share on other sites More sharing options...
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.