@Anonymous wrote:
.... it may not be a polyline. ....
That "may not" could be a problem.... If it's Lines, try this [which will not work if it's a Polyline, as OP1 will]. It doesn't use Fillet, but has the same effect. You can Offset the sides inward or outward or a combination, and any number of sides until you hit Enter to finish.
Keep an eye on the command prompt line for what it's asking for, specifically the Offset distance for each edge and the side to which to Offset it. [Unfortunately, because of the nature of doing Offsets in a (command) function, you don't get to "see" the result on the given side before you pick there.]
Depending on the configuration, and the relationship of the Offset distances to the size of the overall situation, some arrangements may not be able to be joined and cleaned up completely.
It also works if the edges are individual separate Polylines, and if there are Arcs among the edges, again with the caveat that in some arrangements it may not be geometrically possible to get a closed result.
It could be enhanced in assorted ways [in addition to the usual *error* handling and so on], such as to put the results on a different Layer [and create that if needed], to confirm that each thing selected is a Line or Arc so they can be joined in PEDIT, to disallow the Through option for the Offset distance if that should be disallowed, to set the PEDITACCEPT System Variable just in case [this assumes it's set to 1], to check that things are on unlocked Layers, to ask again for a missed pick or a wrong entity type, etc.
(defun C:OSFC ; = Offset Sides and Fillet Corners
(/ lines fuzz lsel)
(setq
lines (ssadd); initially empty set
fuzz 0
); setq
(while
(setq lsel (entsel "\nLine to Offset and include in new polygon <exit>: "))
(redraw (car lsel) 3); highlight
(command "_.offset" pause lsel pause ""); 1st pause for distance, 2nd for side
(redraw (car lsel) 4); un-highlight
(ssadd (entlast) lines); put result in set
(setq fuzz (max fuzz (getvar 'offsetdist))); biggest Offset distance used so far
); while
(command
"_.pedit" "_multiple" lines "" "_join" (* fuzz 2) ""
;; hopefully big enough fuzz factor to catch all when outboard
"_.explode" "_last" ;; <-- OMIT to leave as Polyline
); command
(princ)
); defun
Kent Cooper, AIA