YMG,
As to the Boundary filtering, I have modified the code I presented and it has worked to perfection. I removed all the EXTRIM code, and changed the SS selections to _WP and _X.
; Required Express tools
; OutSide Contour Delete with Extrim
; Found at http://forums.augi.com/showthread.php?t=55056
(defun C:OCD ( / en ss lst ssall bbox)
(vl-load-com)
(if (and (setq en (car(entsel "\nSelect contour (polyline): ")))
(wcmatch (cdr(assoc 0 (entget en))) "*POLYLINE"))
(progn
;; *** commented out ***
;;(setq bbox (ACET-ENT-GEOMEXTENTS en))
;;(setq bbox (mapcar '(lambda(x)(trans x 0 1)) bbox))
(setq lst (ACET-GEOM-OBJECT-POINT-LIST en 1e-3))
(ACET-SS-ZOOM-EXTENTS (ACET-LIST-TO-SS (list en)))
(command "_.Zoom" "0.95x")
;; *** commented out ***
; (if (null etrim)(load "extrim.lsp"))
; (etrim en (polar
; (car bbox)
; (angle (car bbox)(cadr bbox))
; (* (distance (car bbox)(cadr bbox)) 1.1))
; )
;; changed selections to _WP and _X, and added 3DFACE filtering
(if (and
(setq ss (ssget "_WP" lst '((0 . "3DFACE")))) ;; select TINs inside polygon
(setq ssall (ssget "_X" (list (cons 0 "3DFACE")))) ;; select all TINs in drawing
)
(progn
(setq lst (vl-remove-if 'listp (mapcar 'cadr (ssnamex ss))))
(foreach e1 lst (ssdel e1 ssall))
(ACET-SS-ENTDEL ssall)
)
) ; end if
) ; end progn
)
)
Afterward however, I had to modify the Boundary Polyline to a 2d Polyline. Then I used the OFFSET function to expand the Poly by 0.01 feet. When I activated OCD it cleaned out all 3dFaces that were outside my selected area... with no fault.
I imagine that the manual parts can be automated by creating a copied Polyline, as a new entity, and reducing it to a 2dPoly. Then its first point can be used to inverse to the second and last points.
Since the Boundary was created in a clockwise direction, those angles (added by right-perpendicular to the first, and left-perpendicular to the second) can be averaged, then their result may be reversed to create a selection point that is outside the Boundary. I don't remember if LISP will allow this, but the averaged angle could be used "as-is" with the distance being negative (-0.01).
Then use the OFFSET function, give it the 2dPoly and the point that was created. Then the 2dPoly can be erased and the OFFSET poly can be selected for the OCD routine.
Lastly, the OFFSET poly can be erased... the original Boundary line is still intact.
This method works better than selecting by FENCE, because it deletes the detached external 3dFaces as well as the Fenced.
Rick