CUT utility, can someone help with AutoLisp?

Discussion in 'AutoCAD' started by Jeff Kogut, Sep 10, 2003.

  1. Jeff Kogut

    Jeff Kogut Guest

    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
     
    Jeff Kogut, Sep 10, 2003
    #1
  2. 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
    |
    |
    |
     
    R. Robert Bell, Sep 10, 2003
    #2
  3. 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
     
    J.g.h. ten Elsen, Sep 10, 2003
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.