@Kent1Cooper wrote:
So many questions arise....
What constitutes an "editable vertex" on various entity types? It's obvious enough for a Polyline, since they have what are explicitly called vertices, which are stored in entity data, and have grips at them. But the midpoints of segments also have grips -- do you want those considered? For a Line, do you want only locations defined/stored in entity data [which would mean only its endpoints], or all Osnappable or grip-marked locations [which would add the midpoint]? For an Arc, the endpoints and midpoint have grips at them, but none of those are stored in entity data, so they need to be calculated. For a Spline, if it's an original drawn by picking a few points, those few Fit points are stored in entity data and extractable easily enough, but if it's the result of certain operations such as Offsetting from another Spline, suddenly it has a heck of a lot more grip points and Control and Fit points in entity data -- how many of those would qualify as locations you want to move Blocks to? Etc., etc.
@dlanorh 's suggestion looks like it would work if the nearest "path" object is a Polyline, but since it's based on rounding to whole parameter values, it will go to places you probably don't want on other entity types. Whole-number parameter values on a Line or Spline are 1-drawing-unit increments along its length, on an Arc are one-radian increments along its direction from the center [which means its start parameter is usually not 0 as for many other entity types], on a Circle are the same but at least the start parameter is 0, etc. Most whole-number parameter locations on other-than-Polyline entities will not fall at "editable vertex" positions, however that is defined.
[Also, it requires you to pick that Polyline. I had the impression from Message 1 that you would want the routine to find the nearest available "path" object. Can you clarify?]
here my notes:
1) I just want move to endpoints (I can them vertex for the polylines)
2) for me, "editable vertex": any vertex that can be modified and can be selected with left click, for example, line and polylines
3) for me, "uneditable vertex": any vertex that can not be modified, for example, lines and polylines inside blocks
4) for every object (POLYLINE, LINE, ARC, LWPOLYLINE, SPLINE, ELLIPSE, 3DPOLYLINE) with "editable vertex" (endpoints that can be selected with a left click) just should be considered their endpoints, but if possible add more options, for example, align block to midpoints, is welcome.
5) I need to select multiple blocks and select other multiple lines, if this is complicated, then just move the block to the nearest "editable vertex" (endpoints) in the entire drawing or showed objects.
6) thanks for your reply.