@Anonymous wrote:
I would like to fillet certain vertices of a polyline by selecting them.
not the whole polyline.
the radius would be set as part of the lisp.
....
Assuming that you mean to select once at a vertex, in simplest terms and lightly tested, try this:
(vl-load-com)
(defun C:FPSV (/ ver pl par); = Fillet Polyline at Selected Vertices
(setvar 'osmode 1); ENDpoint only
(command "_.fillet" "_radius" pause)
(while
(and
(setq ver (getpoint "\nPolyline Vertex to Fillet: "))
(wcmatch (cdr (assoc 0 (entget (setq pl (ssname (ssget ver) 0))))) "*POLYLINE")
); and
(setq par (vlax-curve-getParamAtPoint pl ver))
(command
"_.fillet"
(vlax-curve-getPointAtParam pl
(-
(if (= par 0) (vlax-curve-getEndParam pl) par)
0.25
); -
); ...getPoint
(vlax-curve-getPointAtParam pl
(+
(if (= par (vlax-curve-getEndParam pl)) 0 par)
0.25
); +
); ...getPoint
); command
); while
(princ)
)
HOWEVER, be aware that so far it doesn't account for certain possibilities:
1) It will fail if you pick at a vertex that has an arc segment on either side [it could be made to notify the User and continue, rather than end, but it would add considerable complexity]. Consequently, it won't re-Fillet an already-Filleted corner at a different radius, the way regular Fillet can do in a Polyline, but requires that a "sharp" corner be selected;
2) It doesn't disallow Polylines on locked Layers;
3) It would allow selection on a 3D Polyline, which can't be Filleted;
4) It could fail or have unintended results if there are other things in the area that the Fillet command might "see" at the places where it picks on the Polyline segments. [Unfortunately, unlike with the Break command, which you can give an entity name and then the Break points, you can't give Fillet an entity name and then the pick points, to ensure its not seeing some other object(s).]
And it doesn't save the current OSMODE or FILLETRAD settings and reset them when done, nor have error handling or command-echo suppression or Undo begin-end wrapping, or other bells and whistles, but those can be added if it otherwise does what you're after.
Kent Cooper, AIA