- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to make a lisp routine that will automate the task of trimming pipes (represented as single lines) so that one pipe appears to run over the other.
I would like the routine to prompt to select the intersection, draw a circle around the intersection, trim one of the pipes as selected by the user, and finally delete the circle.
Here is the code I have been working with:
(defun c:pcut ( / cr sn pt circle tp )
(setq sn (getvar "osmode"))
(command "osmode" "544" )
(prompt "\nSelect point to cut:")
(setq pt (getpoint))
(prompt "\nSelect cut radius:")
(setq cr (getdist))
(prompt "\nSelect pipe to trim")
(setq tp (getpoint))
(command "circle" pt cr)
(setq circle (entlast))
(command "trim" circle " " tp " " )
(entdel circle)
(command "osmode" sn )
)
When I run this routine, I get the following error:
*Invalid selection*
Expects a point or Window/Last/Crossing/BOX/ALL/Fence/WPolygon/CPolygon/Group/Add/Remove/Multiple/Previous/Undo/AUto/SIngle
; error: Function cancelled
Any help would be greatly appreciated.
Solved! Go to Solution.