@Kent1Cooper wrote:
.... I think this could be done with an AutoLisp routine, by calculation, without actually drawing the Lines. ....
I managed to work something up -- not as involved as I originally thought it might be, because a Break command can take points that are not on the object being broken, so it can just use the Polyline vertices.
It could use the usual *error* handling, etc., and it could be enhanced to verify that the User actually picked a Circle and a closed Polyline, and even that the Circle is actually inside the Polyline, and so on. But for now, if you can ensure the correct selections yourself, in limited testing [I tried both LW and 3D Polylines, and Circles in and not in the current Coordinate System], it seems to work:
(defun C:BCinP ; = Break Circle INside Polyline
(/ getpt crv ctr pl osm n)
(defun getpt (par)
(trans (vlax-curve-getPointAtParam pl par) 0 1)
); defun
(setq crv (car (entsel "\nSelect Circle to be Broken: ")))
(redraw crv 3); highlight
(setq
ctr (cdr (assoc 10 (entget crv)))
pl (car (entsel "\nSelect surrounding Polyline: "))
osm (getvar 'osmode)
); setq
(setvar 'osmode 0)
(command "_.ucs" "_object" crv); to draw Arc in first Break
(command ; can't single-point Break a Circle; take piece out and fill in:
"_.break" crv (getpt 0) (getpt 1); resulting Arc has same entity name
"_.arc"
(trans (vlax-curve-getEndPoint crv) 0 1)
"_c" "0,0"
(trans (vlax-curve-getStartPoint crv) 0 1)
"_.chprop" "_last" "" "_layer" (cdr (assoc 8 (entget crv))) ""
); command
(repeat (- (setq n (fix (vlax-curve-getEndParam pl))) 2)
(command "_.break"
(ssname (ssget "_F" (list '(0 0 0) (getpt (setq n (1- n)))) '((0 . "ARC"))) 0)
; remaining Arc [whether = to 'crv' depends on direction Polyline was drawn]
(getpt n) (getpt n); single-point
); command
); repeat
(command "_.ucs" "_previous")
(setvar 'osmode osm)
(princ)
); defun
(vl-load-com)
Kent Cooper, AIA