TheSwamp

CAD Forums => CAD General => Topic started by: ELOQUINTET on September 29, 2004, 04:03:29 PM

Title: break at point question
Post by: ELOQUINTET on September 29, 2004, 04:03:29 PM
just out of curiousity, when i use the break at point command it works fine but if i hit enter to do it again it screws up the line like this:

             |
 line 1    |   gap  line 2
   ______|   _________
             |
             |
forgive the crude drawing :oops:
Title: break at point question
Post by: ELOQUINTET on September 29, 2004, 04:04:53 PM
ah not what my screen showed basically it doesn't break it clean it puts a gap on one side
Title: break at point question
Post by: Dommy2Hotty on September 29, 2004, 04:08:36 PM
Not that this is what you're looking for, but here's the Menu Macro I made...I could change it to a LISP for ya if you wanted, so that you could hit "ENTER" to re-initiate it.

Code: [Select]

[Break @ Selected Point]^C^C^C^P(setq ent(entsel "Select Object to Break...")) \(setq pt(getpoint "Select Break Point...")) \break;!ent;f;!pt;!pt;^P
Title: break at point question
Post by: Kate M on September 29, 2004, 04:41:10 PM
I think that's just how macros work -- you can't re-initiate "break at point" without hitting the button again.

Dommy, a lisp would be cool, though. :-)
Title: Re: break at point question
Post by: CADaver on September 29, 2004, 04:48:59 PM
Quote from: eloquintet
just out of curiousity, when i use the break at point command it works fine but if i hit enter to do it again it screws up the line like this:

             |
 line 1    |   gap  line 2
   ______|   _________
             |
             |
forgive the crude drawing :oops:
The macro issues the BREAK command and fills in the second point for you.  When you hit the enter key it just repeats the BREAK command.  You'll need a lisp function for it to repeat ant the enter key.
Title: break at point question
Post by: whdjr on September 29, 2004, 04:52:52 PM
Here's a lisp I wrote to do just that:
Code: [Select]
(defun c:bk (/ ent)
  (command "break"
  (setq ent (entsel "\nPick point to break Object:  "))
  (cadr ent)
  )
  (princ)
)

Try it you might like it.
Title: break at point question
Post by: Dommy2Hotty on September 29, 2004, 04:56:47 PM
Quote from: Kate M
Dommy, a lisp would be cool, though. :-)

Download BAP.LSP (http://www.theswamp.org/lilly_pond/dommy2hotty/lisp/BAP.LSP?nossi=1)

Code: [Select]
;;***********************************************
;;                  BAP.lsp                     *
;;           Break At selected Point            *
;;          Created by Dominic Cesare           *
;;             Dommy2Hotty@aol.com              *
;;                 09.29.2004                   *
;;***********************************************

(prompt "\nType BAP to run.....")

;;**********************
;;Start of Routine     *
;;**********************

(defun c:BAP (/ oldecho ent pt)

  ;error trapping
  (setq temperr *error*)
  (setq *error* trap1)

  ;current variables
  (setq oldecho (getvar "cmdecho"))

  ;turning off echo
  (setvar "cmdecho" 0)

  ;setting undo beginning
  (command "undo" "begin")

  ;user supplied information
  (setq ent (entsel "Select Object to Break....."))
  (setq pt (getpoint "Select Break Point....."))

  ;break command using user information
  (command "break" ent "f" pt pt)

  ;error trapping
  (setq *error* temperr)

  ;setting undo end
  (command "undo" "end")
 
  ;resetting echo
  (setvar "cmdecho" oldecho)
  (princ)
  )

;defining error trapping
(defun trap1 (errmsg)
  (command "u")
  (setvar "cmdecho" oldecho)
  (setq *error* temperr)
  (prompt "Resetting System Variables...")
  (princ)
  )

;;**********************
;;End of Routine       *
;;**********************
Title: break at point question
Post by: ELOQUINTET on September 30, 2004, 11:22:41 AM
ah i had forgotten i's posted this question so busy yesterday. works great dommy just what the doctor ordered thanks a bunch that's goin in my nostromo 52  :wink:
Title: break at point question
Post by: Dommy2Hotty on September 30, 2004, 11:25:11 AM
Quote from: eloquintet
ah i had forgotten i's posted this question so busy yesterday. works great dommy just what the doctor ordered thanks a bunch that's goin in my nostromo 52  :wink:


No problem...nothing fancy at all, really...
Title: break at point question
Post by: ELOQUINTET on September 30, 2004, 11:34:17 AM
K.I.S.S.

keep it simple stoopid  :P
Title: break at point question
Post by: Dommy2Hotty on September 30, 2004, 11:46:32 AM
Quote from: eloquintet
K.I.S.S.

keep it simple stoopid  :P


 :lol: Changed the order in the LISP...set the echo back too soon...so all you'll see now (if you re-download it) would be the prompts for the line and the point...
Title: break at point question
Post by: CAB on September 30, 2004, 01:46:50 PM
Here is another simple one.

Code: [Select]
(defun C:BRAT(/ user)
  ;(setvar "CMDECHO" 0)
  (setq user (getvar "OSMODE"))
  (command "OSNAP" "int")
  (command "_.BREAK" pause "F" pause "@")
  (setvar "OSMODE" user)
  ;( setvar "CMDECHO" 1)
)
Title: break at point question
Post by: whdjr on September 30, 2004, 03:56:29 PM
Quote from: CAB
Here is another simple one.

Wasn't mine simple enough????
Quote from: whdjr
Here's a lisp I wrote to do just that:
Code:
(defun c:bk (/ ent)
  (command "break"
      (setq ent (entsel "\nPick point to break Object:  "))
      (cadr ent)
  )
  (princ)
)

Try it you might like it.
Title: break at point question
Post by: PDJ on September 30, 2004, 07:16:56 PM
OK CAB, that's SCARY!!  Here's the code I use:

Code: [Select]
(defun C:BRAT()
  (setq user (getvar "OSMODE"))
  (command "OSNAP" "int")
  (command "BREAK" pause "F" pause "@")
  (setvar "OSMODE" user)
)



Great minds think alike I reckon..
Title: break at point question
Post by: CAB on September 30, 2004, 09:53:41 PM
Quote from: PDJ
OK CAB, that's SCARY!!  Here's the code I use:

Code: [Select]
(defun C:BRAT()
  (setq user (getvar "OSMODE"))
  (command "OSNAP" "int")
  (command "BREAK" pause "F" pause "@")
  (setvar "OSMODE" user)
)



Great minds think alike I reckon..

Paul,
Did we steal it from the same place? :)  Or maybe I stole yours. :D
Title: break at point question
Post by: CAB on September 30, 2004, 10:04:47 PM
Quote from: whdjr
Quote from: CAB
Here is another simple one.

Wasn't mine simple enough????
Quote from: whdjr
Here's a lisp I wrote to do just that:
Code:
(defun c:bk (/ ent)
  (command "break"
      (setq ent (entsel "\nPick point to break Object:  "))
      (cadr ent)
  )
  (princ)
)

Try it you might like it.


It was fine, I was just sharing my old routine.
Yours works with one click, very nice. But Osnaps will foil it.
I think I would do it this way.
Code: [Select]
(defun c:bk (/ ent)
  (and (setq ent (entsel "\nPick point to break Object: "))
       (command ".break" ent "non" (cadr ent)) )
  (princ)
)


I like the two pick because it assure the correct line is broken when picking
at an intersection.
Title: break at point question
Post by: CAB on September 30, 2004, 10:38:55 PM
Here is another one point pick that uses crosshair ILO pick box.
Code: [Select]
;;  Break at pick point with cross hair
;;  Pick point is osnaps sensitive, can cause selection
;;  of wrong object or point, press F3 if needed
(defun c:bk (/ pt ent)
  (and (setq pt (getpoint "\nPick point to break Object: "))
       (setq ent (nentselp pt))
       (command ".break" ent "non" pt))
  (princ)
)
Title: break at point question
Post by: whdjr on October 01, 2004, 09:05:48 AM
Quote from: CAB
It was fine, I was just sharing my old routine.
Yours works with one click, very nice. But Osnaps will foil it.
I think I would do it this way.


Running osnaps don't work while using entsel unless you type it in, at least in A2K.
Title: break at point question
Post by: CAB on October 01, 2004, 09:17:35 AM
With MID on select a point very close to the mid point on a line.
In ACAD2000 a small gap is removed because the picked point is
not at the mid point and the second point (cadr ent) is affected
by the snap and goes to the mid point of the line.
Title: break at point question
Post by: whdjr on October 01, 2004, 09:44:01 AM
Quote from: CAB
With MID on select a point very close to the mid point on a line.
In ACAD2000 a small gap is removed because the picked point is
not at the mid point and the second point (cadr ent) is affected
by the snap and goes to the mid point of the line.

I was talking my code.
Title: break at point question
Post by: CAB on October 01, 2004, 10:03:37 AM
Quote from: whdjr
Quote from: CAB
With MID on select a point very close to the mid point on a line.
In ACAD2000 a small gap is removed because the picked point is
not at the mid point and the second point (cadr ent) is affected
by the snap and goes to the mid point of the line.

I was talking my code.

So am I :)