Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Kent1Cooper
en respuesta a: jeff.wangD95HG


@jeff.wangD95HG wrote:

... a tool that will create a point at all the corners of poly line.

Then I want to take another EXISTING polyline that is reasonably the same shape and I want to snap that polyline to all the point. ....


For the first item, modifying an earlier routine of mine that put Blocks at all vertices:

 

(vl-load-com)
(defun C:PAPV (/ esel n); = Points at All Polyline Vertices
  (if
    (and
      (setq esel (entsel "\nSelect Polyline: "))
      (wcmatch (cdr (assoc 0 (entget (setq pl (car esel))))) "*POLYLINE")
    ); and
    (repeat ; then
      (setq n (fix (+ (vlax-curve-getEndParam pl) (if (vlax-curve-isClosed pl) 0 1))))
      (command "_.point" "_none" (vlax-curve-getPointAtParam pl (setq n (1- n))))
    ); repeat
    (prompt "\nNothing selected, or not a Polyline.")
  ); if
  (prin1)
); defun

 

That can be made to allow multiple selection and add the Points to all of them, easily enough.

 

For the second item, do you mean you want to force the existing other Polyline to share all the vertices of the one with the Points?  How about just copying the one with the Points, in-place, and forgetting the other one?  Or explain why that won't work [e.g. they're on different Layers and you want to retain that difference, perhaps?].  It's not difficult to impose one Polyline's vertices on another one, though it won't handle other kinds of differences between them, such as one containing arc segments that the other does not, or having arcs as different segments than the other.

Kent Cooper, AIA