@SeeMSixty7 wrote:
.... I think the @Anonymous's issue is he may have selected something other than lines in his selection set.
@Anonymous Try the command and keep your selection set to just LINES.
If that's the problem, there could be two reasons for it:
1) They selected some appropriate Lines but also some other things [such as in a Window selection];
2) The "lines" are really single-segment Polylines.
If it's 1), you can restrict the selection to only Lines, no matter what else may be in the area, by changing both instances of
(ssget)
to
(ssget '((0 . "LINE")))
and it won't "see" any other kind of entity in the selection.
If it's 2), you can allow Polylines in addition to Lines [even a combination of both types], by changing the above to:
(ssget '((0 . "LINE,LWPOLYLINE")))
and changing these lines in both commands:
(setq ha6 (cdr (assoc 10 (entget (ssname ha1 ha2)))))
(setq ha7 (cdr (assoc 11 (entget (ssname ha1 ha2)))))
to these instead:
(setq ha6 (vlax-curve-getStartPoint (ssname ha1 ha2)))
(setq ha7 (vlax-curve-getEndPoint (ssname ha1 ha2)))
and if necessary, adding
(vl-load-com)
somewhere. In that case, it may be worth adding some other checks, such as whether any Polylines selected are made of one line segment only.
Kent Cooper, AIA