CUT utility, can someone help with AutoLisp?

Jeff Kogut

Usenet Archive
Joined
Sep 10, 2003
Messages
1
Reaction score
0
Hello,

I've been using a script for years that I've really gotten used to, but I'm not up to speed with AutoLisp. It's called 'Cut' and it uses the Break command. I've recently moved to a company that uses AutoCAD 2002 and it seems they've revised the Break command and my script no longer works.

;;;CUT command, added by Jeff Kogut 9/8/03
;To use CUT routine, first select the line you want to cut, ; then select the point where you wnat it cut. You can use ;all OSNAP options in defining the cut point.8/9/90 works ; (prompt "Loading CUT utility...") (defun C:CUT (/ pnta pntb) (setvar "cmdecho" 0) (prompt "\nSelect line to break:") (setq pnta (car (entsel))) (setq pntb (getpoint "\nEnter Cut Point: ")) (command "BREAK" pnta "f" pntb pntb) (setvar "cmdecho" 1)
)

Can anyone help? Thanks in advance!

Jeff
 
You want to also make sure that running OSnaps aren't a problem:

(command "._BREAK" "_non" pnta "_f" "_non" pntb "_non" pntb)

--
R. Robert Bell, MCSE
www.AcadX.com

| Hello,
|
| I've been using a script for years that I've really gotten used to, but I'm | not up to speed with AutoLisp. It's called 'Cut' and it uses the Break | command. I've recently moved to a company that uses AutoCAD 2002 and it | seems they've revised the Break command and my script no longer works. | | ;;;CUT command, added by Jeff Kogut 9/8/03 | ;To use CUT routine, first select the line you want to cut, | ; then select the point where you wnat it cut. You can use | ;all OSNAP options in defining the cut point.8/9/90 works | ; | (prompt "Loading CUT utility...") | (defun C:CUT (/ pnta pntb) | (setvar "cmdecho" 0) | (prompt "\nSelect line to break:") | (setq pnta (car (entsel))) | (setq pntb (getpoint "\nEnter Cut Point: ")) | (command "BREAK" pnta "f" pntb pntb) | (setvar "cmdecho" 1) | ) | | | Can anyone help? Thanks in advance! | | Jeff | | |
 
I found this some time ago, it works perfect

(defun c:qb (/ pt1 pt2 pt3 aa aantal teller bb)
(setq cmde (getvar "cmdecho"))(setvar "cmdecho" 0)
(setq osm (getvar "osmode" ))(setvar "osmode" 512)
(setq blm (getvar "blipmode"))( setvar "blipmode" 0)
(setq pt1 (getpoint "\nBreekpunt. "))
(setvar "osmode" 0)
(setq pt2 (polar pt1 (/ PI 6) 1)
pt3 (polar pt1 (+ (/ PI 6) PI) 1)
aa (ssget "C" pt2 pt3)
aantal (sslength aa)
)
(setq teller 0)
(repeat aantal
(setq bb (ssname aa teller))
(command "BREAK" bb pt1 pt1)
(setq teller (1+ teller))
)
( setvar "blipmode" blm )
( setvar "osmode" osm )
( setvar "cmdecho" cmde )
(princ)
)

Johan
 
Back
Top