I was recently contacted with a question asking whether it was possible to offset a closed boundary formed of objects such as splines & ellipses, which could obviously not be joined to form a continuous closed polyline.
As far as I was aware, there is no standard AutoCAD command or Visual LISP method which will allow you to simultaneously offset multiple objects forming a closed boundary, whilst retaining the continuous boundary edge – each object forming the boundary would need to be offset separately, which would consequently result in the object endpoints no longer being coincident and the continuous boundary would be broken.
My alternative solution was to convert the closed boundary (or a copy of the closed boundary) to a region (
REGION command), convert the region to a surface (
CONVTOSURFACE command), offset the edge of the surface (
OFFSETEDGE command), and then delete the surface and explode the region.
I attempted to automate the process in LISP, however, it doesn't appear to be possible to automate the
OFFSETEDGE command, as the following program still requires the user to select the surface created by the program:
;; Boundary Offset - Lee Mac
(defun c:boffset
( / *error* ent idx lst reg sel sur
)
)
)
(if (setq sel
(ssget "_:L" '
((0 .
"LINE,*POLYLINE,CIRCLE,ARC,ELLIPSE,SPLINE")))) )
'paperspace
'modelspace
)
)
'addregion lst
)
)
)
)
(command "_.convtosurface" (vlax
-vla
-object
->ename
(car reg
)) "") )
)
)
)
)
)
)
A quick demo:
The following questions remain:
- Have I perhaps overlooked a better way to achieve this result?
- Is there a way to automate the OFFSETEDGE command?
Nevertheless, I hope the above proves useful to someone.
Lee