http://www.theswamp.org/index.php?topic=52402.0![](http://www.theswamp.org/index.php?action=dlattach;topic=52402.0;attach=33516;image)
The original post hopes to achieve this by cutting the entities within the block. I think it is not as convenient and versatile as the CLIP method.
![](http://www.theswamp.org/index.php?action=dlattach;topic=58796.0;attach=41624;image)
Main Function:
1. xdrx-geom-searchregions
2. xdrx-entity-sortoncurve
3. xdrx-insert-clip
(and (setq blkref1
(car (xdrx
-entsel "\nSelect INSERT <Quit>:" '
((0 .
"insert"))))) (setq ln
(car (xdrx
-entsel "\nPick Curve<Quit>:" '
((0 .
"*line"))))) (setq box
(xdrx
-entity
-box blkref1
) ; insert bounding box box
(xd::pnts:
close box
) ; closed )
(setq ints
(xdrx
-entity
-intersectwith ln box
)) ; find the intersection point
)
(xdrx-begin)
(setq ge
(xdge::constructor
"kcompositecrv3d" box
) ;Construct LWPOLYLINE geometric object
crv (xdrx-entity-make ge)
;;Generate LWPOLYLINE
)
(if (setq regions
(xdrx
-geom
-searchregions ln crv t
)) ; Query to create closed regions
(setq regions
(xdrx
-pickset
->ents regions
) ents (xdrx-entity-sortoncurve
; Sort entities along the specified entity
regions
)
blkref2 (xdrx-entity-copy blkref1)
; Create an INSERT copy
)
(xdrx
-insert
-clip blkref1
(car ents
)) ;Create XCLIP (xdrx
-insert
-clip blkref2
(cadr ents
)) ;Create XCLIP (xdrx-entity-delete ents)
(xdrx-object-regen blkref2) ;The object itself REGEN
;(xdrx-entity-move blkref2 (car box) (cadr box))
(xd::drag:simplemove blkref2 "\nInsertion point:" 5 t)
;Drag to move
)
)
(xdrx-end)
)
)
)