help with making a routine for trim and extend that prompts for an edge
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, I am using Autocad 2022, upgraded from 2018, and noticed the trim and extend native commands have been changed to allow faster operation without having to select an edge or object. However, sometimes a selection is faster. I want to create a lisp routine that forces it to ask for a selection. I would preload it in my acad.lsp so whenever it is typed, its ready to go.
TR = Trim
TT would be the script (LSP) for trim with edge
EX = Extend
EE would be the script to extend with edge
Wondering if this has been made already. I was trying to make a script, but could not get it to allow me to select the edge and continue.
Any help would be appreciated. I am assuming if I can get one to work, the other would be very similar to make.
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Custom commands by John Crocco 2-17-22
;Extend command with forced edge to be selected when prompted
(DEFUN C:EE (/ SS *error*)
;;;;;;;;; Application error handler
(defun *error* (msg)
(command-s "._Undo" "_End") ; end undo group
(cond
((not msg)) ; no error, do nothing
((member (strcase msg t) ; cancel, do undo
'("console break"
"function cancelled"
"quit / exit abort"
)
)
(command-s "._U")
(setvar "cmdecho" cecho)
;UNDO COMMANDS HERE
;
;
;
) ;END OF MEMBER
((princ (strcat "\nError: " msg)))
) ; END OF COND
(princ)
) ; END OF DEFUN ERROR
(vl-load-com)
(setq cecho (getvar "cmdecho"))
(setvar "CmdEcho" 0) ; turn echo off
(command-s "._Undo" "_End") ; close any open group
(command-s "._Undo" "_BEgin") ; start new group
;;;;;;;;;;;;;;;;;;;;;;
(PRINC "SELECT BOUNDERY OBJECTS...\N")
(SETQ SS (SSGET)) ;GENERAL SELECTION SET
(command "extend" "B" SS \ "")
)