+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 12

Thread: Break Lisp

  1. #1
    Senior Member neekcotrack's Avatar
    Using
    MEP 2009
    Join Date
    May 2008
    Location
    Florida
    Posts
    329

    Exclamation Break Lisp

    Does anyone know of a lisp that breaks at line:

    1. If you click the line you want to break.
    2. Then click the line you want it to break with.
    3. It breaks the line on both sides evenly depending on the dimscale what the distance of how far.

  2. #2
    Super Member CAB's Avatar
    Using
    AutoCAD 2000
    Join Date
    May 2004
    Location
    Tampa, Florida
    Posts
    803

    Default

    Code:
    ;;;=======================[ BreakObjects.lsp ]==============================
    ;;; Author: Copyright© 2006-2008 Charles Alan Butler 
    ;;; Contact @  www.TheSwamp.org
    ;;; Version:  1.8 Mar. 13,2008
    ;;; Purpose: Break All selected objects
    ;;;    permitted objects are lines, lwplines, plines, splines,
    ;;;    ellipse, circles & arcs 
    ;;;                            
    ;;;  Function  c:MyBreak -       DCL for selecting the routines
    ;;;  Function  c:BreakAll -      Break all objects selected with each other
    ;;;  Function  c:BreakwObject  - Break many objects with a single object
    ;;;  Function  c:BreakObject -   Break a single object with other objects 
    ;;;  Function  c:BreakWith -     Break selected objects with other selected objects
    ;;;  Function  c:BreakTouching - Break objects touching selected objects
    ;;;  Function  c:BreakSelected - Break selected objects with any objects that touch it 
    ;;;
    ;;;  Function  break_with  - main break function called by all others and
    ;;;                          returns a list of new enames, see c:BreakAll
    ;;;                          for an example of using the return list
    ;;;
    ;;; Requirements: objects must have the same z-value
    ;;; Restrictions: Does not Break objects on locked layers 
    ;;; Returns:  none
    ;;;
    ;;; Revision 1.8 Added Option for Break Gap greater than zero
    ;;;

  3. #3
    Senior Member neekcotrack's Avatar
    Using
    MEP 2009
    Join Date
    May 2008
    Location
    Florida
    Posts
    329

    Default

    so will this break a one of two lines intersecting on both side and make the line line 2 units from the line it was intersecting with and changes the 2 units if the dimscale changes?

  4. #4
    Senior Member neekcotrack's Avatar
    Using
    MEP 2009
    Join Date
    May 2008
    Location
    Florida
    Posts
    329

    Default

    Where do I find the breakobjects lisp?

  5. #5
    Super Member CAB's Avatar
    Using
    AutoCAD 2000
    Join Date
    May 2004
    Location
    Tampa, Florida
    Posts
    803

    Default

    Quote Originally Posted by neekcotrack View Post
    so will this break a one of two lines intersecting on both side and make the line line 2 units from the line it was intersecting with and changes the 2 units if the dimscale changes?
    Does not have anything to do with DimScale.
    You select the GAP size you want. The routine has a variety of options for selections to break & break with.
    The latest version is found here.
    http://www.theswamp.org/index.php?to...7166#msg277166
    You must be a forum member to use this link.

  6. #6
    Full Member
    Using
    AutoCAD 2008
    Join Date
    Feb 2008
    Posts
    53

    Default

    Perhaps this is something to get you started:
    Code:
    (defun c:BM( / L1 P1 P2)
      (defun *error* (MSG) ; local error handler to reset entity redraw
        (princ (strcat "\n" MSG))  ; return the error message
        (if osm (setvar "osmode" osm))
      )
       (setq osm (getvar "osmode"))
       (Setq L1 (entsel "\nSelect object to break: "))
       (while L1 (progn
                    (Setq P1 (getpoint "\nChoose break point: "))
                    (command "BREAK" L1 "F" P1 "@")
            (setq L1 (entsel "\nSelect next object to break, or ENTER: "))
                (setvar "osmode" osm)
                 );end progn
       );end while
    )  ;end defun

  7. #7
    Senior Member neekcotrack's Avatar
    Using
    MEP 2009
    Join Date
    May 2008
    Location
    Florida
    Posts
    329

    Default

    Thanks for everything.

  8. #8
    Senior Member neekcotrack's Avatar
    Using
    MEP 2009
    Join Date
    May 2008
    Location
    Florida
    Posts
    329

    Default

    The breakwith.lsp is what I am looking for sept for a one things.

    1. I want it to automatically set the break gap to (2 times (getvar "dimscale"))

    If anyone can help me I am thanking you in advance!

  9. #9
    Super Member CAB's Avatar
    Using
    AutoCAD 2000
    Join Date
    May 2004
    Location
    Tampa, Florida
    Posts
    803

    Default

    Make sure the BreakObject lisp is loaded & use this;
    Code:
    (defun c:BreakWithMyGap (/ cmd ss1 ss2 tmp)
    
      (command "_.undo" "_begin")
      (setq cmd (getvar "CMDECHO"))
      (setvar "CMDECHO" 0)
      (setq Bgap (* 2.0 (getvar "dimscale")))
      ;;  get objects to break
      (prompt "\nBreak selected objects with other selected objects.")
      (prompt "\nSelect object(s) to break & press enter: ")
      (if (and (setq ss1 (ssget '((0 . "LINE,ARC,SPLINE,LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE"))))
               (not (ssredraw ss1 3))
               (not (prompt "\n***  Select object(s) to break with & press enter:  ***"))
               (setq ss2 (ssget '((0 . "LINE,ARC,SPLINE,LWPOLYLINE,POLYLINE,CIRCLE,ELLIPSE"))))
               (not (ssredraw ss1 4))
          )
        (break_with ss1 ss2 nil Bgap) ; ss1break ss2breakwith (flag nil = not to break with self)
      )
    
      (setvar "CMDECHO" cmd)
      (command "_.undo" "_end")
      (princ)
    )

  10. #10
    Senior Member neekcotrack's Avatar
    Using
    MEP 2009
    Join Date
    May 2008
    Location
    Florida
    Posts
    329

    Default

    Registered forum members do not see this ad.

    do I just put this in with the breakobjects lisp

Similar Threads

  1. Break Line Lisp
    By neekcotrack in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 14th Aug 2012, 06:12 pm
  2. custom break or break settings
    By b.muqlueen in forum AutoLISP, Visual LISP & DCL
    Replies: 8
    Last Post: 2nd Apr 2008, 05:46 pm
  3. custom break or break settings
    By b.muqlueen in forum AutoLISP, Visual LISP & DCL
    Replies: 0
    Last Post: 2nd Apr 2008, 01:19 pm
  4. Break at Point
    By Rooster in forum AutoCAD Drawing Management & Output
    Replies: 6
    Last Post: 11th Feb 2006, 02:19 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts