Jason,
Nice work! This does exactly what I need. My plan is to use this as a
function and pass entity names to it from an existing while loop.
I have been exposed to the visual lisp coding but haven't actually worked
with it very much. It appears to be easier when wishing to do more complex
processing like this.
Take care,
george
"Jason Kroll" wrote in message
news:AAE89CA38337930DEF1EAE73212239B3@in.WebX.maYIadrTaRb...
> George
>
> Try this. It's a no frills routine. I haven't really tested it fully but
it
> worked with a quick test.
>
> (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)
> )
>
> Regards
> Jason Kroll
>
>
> "George" wrote in message
> news:17D10DEB0AD96B3FA3D5E1FE28A4B7FD@in.WebX.maYIadrTaRb...
> > Good afternoon all,
> >
> > I have, roughly 3000 points that were digitized without the aid of
Object
> > Snaps. Each point represents a leak point on a water main (Polyline).
> The
> > points can be as far away as 8 feet from the main span they should be
> > snapped to.
> >
> > What I'm trying to do is find a polyline near each point and then move
the
> > point perpendicular to the polyline.
> >
> > I can find the point, get its insertion and find the polyline but I
can't
> > seem to figure out how to determine a perpendicular point on the
polyline
> to
> > act as my "move to point".
> >
> > Has anyone done this before? Could you help me out?
> >
> > Thanks, in advance
> > george
> >
> >
>
>