Try this routine I wrote... I allows you to select two lines and then which
one to break. It uses the current Font height to determine the width of the
break.... I called it XL.lsp
So you start off with some lines like:
| | |
__|___|___|___
| | |
| | |
__|___|___|___
| | |
| | |
The you can end up wth:
| | |
_ | __|__ | __
| | |
| | |
__|__ | __|___
| | |
| | |
;; Prog to Break designated line equally on either
;; side of a specified intersection
; ERROR MESSAGE ***********
(defun *error* (s)
(if old_error (setq *error* old_error))
(command "osnap" "non")
(princ)
)
; **** GET BREAK WIDTH ****
(defun brk_wid ( / apt1 apt2 brklin brklin1 brklin2 brkwidth getit getname
lin1 pt1 strtlin strtpt1 strtpt2 trmlin1 trmlin1x
trmlin2 trmlin2x bkwid bkwid_2 brkwid_1)
(cond
((/= brkwid nil)
(setq bkwid_1 brkwid)
(princ (strcat "\nCurrent Break Width is "))
(setq brkwid_2
(getstring "\nEnter Break Width or Return to Accept above: "))
(terpri)
; reset if space entered
(IF (= brkwid_1 nil) (setq brkwid bkwid_2) (setq brkwid brkwid_1))
(IF (= brkwid_1 "") (setq brkwid bkwid_2) (setq brkwid brkwid_1))
)
((= brkwid nil)
(princ (strcat "\nSuggested Break Width is "))
(setq brkwid (getstring "\nEnter Break Width: "))
(terpri)
(IF (= brkwid nil) (exit))
)
)
brkwid
) ; brk_wid
; *** MAIN PROGRAM ***
(defun C:XL ()
(setvar "CMDECHO" 1)
(setq Inmm (getvar "USerI1")) ; find if Inches 1 or MM 0
(setq txthit (getvar "TextSize")) ; get height of selection
; (setq sug_brkwid (* txthit 1.5)) ; set up Default incriment 1.5 x Text
Height
(setq brkwid (* txthit 1.5)) ; set up Default incriment 1.5 x Text Height
; *** MAIN ROUTINE ***
(command "osnap" "int")
(princ "\n ")
(setq pt1 (getpoint "\nSelect INTersection of lines: "))
(princ "\n ")
(command "-osnap" "nea")
(setq lin1 (getpoint "\nSelect LINE to Break: "))
(terpri)
; now work out the Entity Definition Data
(setq getit (ssget lin1))
(setq getname (ssname getit 0))
(setq strtlin (entget getname))
(setq brkwidth brkwid)
(setq strtpt1 (cdr (assoc 10 strtlin))) ; start point
(setq strtpt2 (cdr (assoc 11 strtlin))) ; end point
(setq apt1 (angle strtpt2 strtpt1)) ; start line angle 1
(setq apt2 (angle strtpt1 strtpt2)) ; start line angle 2
(setq trmlin1 (polar pt1 apt1 (/ brkwidth 2.0))) ; trim line 1 point
(setq trmlin1x (polar pt1 apt1 brkwidth)) ; trim line 1x point
(setq trmlin2 (polar pt1 apt2 (/ brkwidth 2.0))) ; trim line 2 point
(setq trmlin2x (polar pt1 apt2 brkwidth)) ; trim line 2x point
(setq brklin (cdr (assoc -1 strtlin))) ; get line name to break
(command "break" brklin trmlin1 trmlin2) ; break line
(command "-osnap" "non")
) ;defun
Regards,
BruceF
I guess I was rather too brief with my question. I do not want to delete any
part of the original lines that are crossed by another, just have two
entities on either side of each intersection point instead of one. Unless
there is some aspect of Trim that I have missed, it is fairly slow to select
the entity, hit F, then click twice in the same spot for a zero-width break
for each entity.
The "Ebrick" function of French program that 'gegematic' pointed me to seems
to fit the bill. Although I cannot cannot select multiple entities to be
broken with one crossing line which stays intact and must pick each one
individually, it can be done serially with no limit, then all are broken
with one Enter stroke.
Extrim is great but I don't want to lose any part of the entities being
broken just have them become two instead of one at the intersecting points.
"Ebrick" that gegematic mentions seems to work.
Thank you for replying.
Thanks! That's a neat program, and I can certainly forsee some uses for it.
What I was looking for now, though, was a zero-width break, and Acad won't
accept a zero height text input, so it seems I can't achieve that.
Since writing sophisticated Lisp programs is well beyond my current skill
level, would you be interested in modifying the program for zero-width
breaks (or for inputting the width) and allowing window or fence selection
of multiple entities to be broken?
If not, or in the meantime, the ARX program 'gegematic' pointed me at does
work, with individual entity selection.
Thanks again,
Joe
Merci!
What an interesting program. I love the indicator markers it leaves at the
selected intersections. This most closely fits the bill for what I needed.
Thanks,
Joe
Here then... try this one. It's what I think you wanted (named BRK.lsp):
;; Breaks a Line at User picked point
; ERROR MESSAGE ***********
;(defun *error* (s)
; (if old_error (setq *error* old_error))
; (princ)
;)
; *** MAIN PROGRAM ***
(Defun C:BRK ( )
(princ "\n ")
(setq pt1 (getpoint "\nPick Point on Line to Break: "))
(command "break" pt1 pt1)
) ;defun
I don't know who made it but here's a crude little lisp I found that does
exactly what you want (Only works for simple line entities):
-------------------------------------------------
(Defun C:BRKPNT (/ ss cnt inf pnt1 pnt2 enam cnt einf pnt3 pnt4 intr)
(Princ "\nSelect lines to break: ")
(Setq ss (SSGet))
(Setq cnt 0)
;(Princ "\nSelect cut edge: ")
(Setq inf (Entget (Car (Entsel "\nSelect line for breaking edge: "))))
(Setq pnt1 (Cdr (Assoc 10 inf)))
(Setq pnt2 (Cdr (Assoc 11 inf)))
(If ss
(Repeat (SSLength ss)
(Setq enam (SSName ss cnt))
(Setq cnt (1+ cnt))
(Setq einf (Entget enam))
(Setq pnt3 (Cdr (Assoc 10 einf)))
(Setq pnt4 (Cdr (Assoc 11 einf)))
(Setq intr (inters pnt1 pnt2 pnt3 pnt4))
(Command "_.BREAK" enam intr intr)
)
)
(Princ))
-------------------------------------------------------
Thank you Michael. It's exctly what I was looking for.
And thank all of you your responses!
Joe
---------------------------------------------------------------------------------------------------------
PolyTech Forum website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.