A double fillet in one click seems impossible...
Fillet Multiple Radius 0 would do it in 4 clicks.
Pedit Multiple Join Fuzz factor would do it with a 2 click crossing box.
Fillet is not necessary, even trim or make a line in between 2 lines and trim all 4 edges also enough.
Yeah true.
I think the Pedit as a small Lisp or script is the fewest clicks but it won't always work - depends upon a combination of how much overlap there is and the fuzz factor used.
is it zero radius fillet/zero distance champher?
Selection of 3 lines. Only.
Fillet / trim needed to happen on the intersection points (2Nos which is crossing 90Dgr)
It's basically my HVAC Duct / Plumbing pipe.
While we draw it is 2 individual lines, I wanna cut the pipe on a location by closing the 2 lines with a line of 90 dgr angle.
Normally I used to do that with fillet cmd 2 times.
Hope there can be a lisp to minimise the process. In a faster way. Is I have to do the same process multiple times on a drawing? gif attached.
@smallƑish wrote:
.... fillet both corners in one click?
....
Selection of 3 lines. Only.
....
That's not one click.
Try the CE command in CAPEND.lsp, >here<. You don't need to draw the Line across the end -- it will do it for you. It does require that the other two Lines line up, such that a Line between their ends would be perpendicular to both, and they both extend in the same direction from there. It does other kinds of ends, but if you always and only use the Line variety, that could be extracted into a separate command, so you don't need to bother accepting that as the default mode.
surely there is
;**************************************************************************************************************************************************
; komondormrex, aug 2023
;**************************************************************************************************************************************************
(defun check_angle (line_list / angle_line_list pattern_angle )
(setq angle_line_list (list (cons 0 (car line_list)))
pattern_angle (vla-get-angle (car line_list))
line_list (cdr line_list)
angle_line_list (append angle_line_list (mapcar '(lambda (line) (cons (cond
(
(or (equal pattern_angle (vla-get-angle line) 1e-3)
(equal pattern_angle (+ pi (vla-get-angle line)) 1e-3)
)
0
)
(
(or (equal (abs (- pattern_angle (vla-get-angle line))) (* 0.5 pi) 1e-3)
(equal (abs (- pattern_angle (vla-get-angle line))) (* 1.5 pi) 1e-3)
)
(* 0.5 pi)
)
(
t
(abs (- pattern_angle (vla-get-angle line)))
)
)
line
)
)
line_list
)
)
)
(cond
(
(= (* 0.5 pi) (apply '+ (mapcar 'car angle_line_list)))
(cdr (assoc (* 0.5 pi) angle_line_list))
)
(
(= pi (apply '+ (mapcar 'car angle_line_list)))
(cdr (assoc 0 angle_line_list))
)
(
t
nil
)
)
)
;**************************************************************************************************************************************************
(defun c:cap_lines (/ tube_lines_sset line_list perpendicular_line intersection_point start_point)
(prompt "Select two parallel lines and one perpendicular to both parallel to make a cap")
(if (and (setq tube_lines_sset (ssget '((0 . "line"))))
(setq line_list (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex tube_lines_sset)))))
(= 3 (length line_list))
(setq perpendicular_line (check_angle line_list))
)
(progn
(setq line_list (vl-remove perpendicular_line line_list))
(foreach line line_list
(if (< (distance (vlax-get line 'startpoint)
(setq intersection_point (inters (vlax-get line 'startpoint)
(vlax-get line 'endpoint)
(vlax-get perpendicular_line 'startpoint)
(vlax-get perpendicular_line 'endpoint)
nil
)
)
)
(distance (vlax-get line 'endpoint)
intersection_point
)
)
(vla-put-startpoint line (vlax-3d-point intersection_point))
(vla-put-endpoint line (vlax-3d-point intersection_point))
)
(if (not start_point)
(setq start_point intersection_point)
)
)
(vla-put-startpoint perpendicular_line (vlax-3d-point start_point))
(vla-put-endpoint perpendicular_line (vlax-3d-point intersection_point))
)
(princ "\nNot three lines selected or they do not hold two parallel lines and one perpendicular line.")
)
(princ)
)
;**************************************************************************************************************************************************
Another single pick. Expects cut line near ends.
(defun c:ffff ( / ent entg entn pt pts ss ent2 mp)
(setq ent (entsel "Pick cut line about middle "))
(setq entg (entget (car ent)))
(setq entn (cdr (assoc -1 entg)))
(setq st (cdr (assoc 10 entg)))
(setq end (cdr (assoc 11 entg)))
(setq pt (cadr ent))
(setq pts (list st end))
(setq ss (ssget "F" pts (list (cons 0 "LINE"))))
(setq ss (ssdel entn ss))
(setvar 'filletrad 0.0)
(setq ent2 (entget (ssname ss 0)))
(setq mp (mapcar '* (mapcar '+ (cdr (assoc 10 ent2))(cdr (assoc 11 ent2))) '(0.5 0.5)))
(command "fillet" mp pt)
(setq ent2 (entget (ssname ss 1)))
(setq mp (mapcar '* (mapcar '+ (cdr (assoc 10 ent2))(cdr (assoc 11 ent2))) '(0.5 0.5)))
(command "fillet" mp pt)
(princ)
)
Hi, I'm trying to modify your routine to select the three lines with a ssget crossing polygon.
I'm getting
; error: bad SSGET list value
at this break point
(ssget "_CP" (mkOCTlist MIDCAP SFACT) (list (cons 0 LINE)))
and I can't figure out why...
;**************************************************************************************************************************************************
(defun check_angle (line_list / angle_line_list pattern_angle )
(setq angle_line_list (list (cons 0 (car line_list)))
pattern_angle (vla-get-angle (car line_list))
line_list (cdr line_list)
angle_line_list (append angle_line_list (mapcar '(lambda (line) (cons (cond
(
(or (equal pattern_angle (vla-get-angle line) 1e-3)
(equal pattern_angle (+ pi (vla-get-angle line)) 1e-3)
)
0
)
(
(or (equal (abs (- pattern_angle (vla-get-angle line))) (* 0.5 pi) 1e-3)
(equal (abs (- pattern_angle (vla-get-angle line))) (* 1.5 pi) 1e-3)
)
(* 0.5 pi)
)
(
t
(abs (- pattern_angle (vla-get-angle line)))
)
)
line
)
)
line_list
)
)
)
(cond
(
(= (* 0.5 pi) (apply '+ (mapcar 'car angle_line_list)))
(cdr (assoc (* 0.5 pi) angle_line_list))
)
(
(= pi (apply '+ (mapcar 'car angle_line_list)))
(cdr (assoc 0 angle_line_list))
)
(
t
nil
)
)
)
;**************************************************************************************************************************************************
(defun mkOCTlist (MIDCAP SFACT)
(mapcar '(lambda (_angle) (polar MIDCAP _angle SFACT))
(mapcar '*
(list 0 (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4))
'(0 1 2 3 4 5 6 7)
);mapcar
);mapcar
)
;**************************************************************************************************************************************************
(defun c:FDM (/ MIDCAP SFACT COUNT tube_lines_sset line_list perpendicular_line intersection_point start_point)
(setvar 'cmdecho 1)
(setvar 'osmode 0)
(setq MIDCAP (getpoint "Select point near cap line : ")
SFACT 0.05
COUNT 0)
(if MIDCAP
(progn
(while (/= COUNT 3)
(setq SFACT (+ SFACT 0.01)
line_list (ssget "_CP" (mkOCTlist MIDCAP SFACT) (list (cons 0 LINE)))
COUNT (sslength line_list))
);while
);progn
);if
(if (and line_list
(setq line_list (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex tube_lines_sset)))))
(= 3 (length line_list))
(setq perpendicular_line (check_angle line_list))
)
(progn
(setq line_list (vl-remove perpendicular_line line_list))
(foreach line line_list
(if (< (distance (vlax-get line 'startpoint)
(setq intersection_point (inters (vlax-get line 'startpoint)
(vlax-get line 'endpoint)
(vlax-get perpendicular_line 'startpoint)
(vlax-get perpendicular_line 'endpoint)
nil
)
)
)
(distance (vlax-get line 'endpoint)
intersection_point
)
)
(vla-put-startpoint line (vlax-3d-point intersection_point))
(vla-put-endpoint line (vlax-3d-point intersection_point))
);if
(if (not start_point)
(setq start_point intersection_point)
);if
);foreach
(vla-put-startpoint perpendicular_line (vlax-3d-point start_point))
(vla-put-endpoint perpendicular_line (vlax-3d-point intersection_point))
);progn
(princ "\nNot three lines selected or they do not hold two parallel lines and one perpendicular line.")
);if
(princ)
)
hi,
at this break point
(ssget "_CP" (mkOCTlist MIDCAP SFACT) (list (cons 0 LINE)))
should be
..... (list (cons 0 "line"))...
you've missed quotes in lines filter.
Thanks. Sometimes easy to miss silly mistakes... Also had variable names a bit mixed up.
All working now. Will probably alter/refine some more and need to deal with lselsetp nil error. Could just snap to midpoint.
;**************************************************************************************************************************************************
(defun check_angle (line_list / angle_line_list pattern_angle )
(setq angle_line_list (list (cons 0 (car line_list)))
pattern_angle (vla-get-angle (car line_list))
line_list (cdr line_list)
angle_line_list (append angle_line_list (mapcar '(lambda (line) (cons (cond
(
(or (equal pattern_angle (vla-get-angle line) 1e-3)
(equal pattern_angle (+ pi (vla-get-angle line)) 1e-3)
)
0
)
(
(or (equal (abs (- pattern_angle (vla-get-angle line))) (* 0.5 pi) 1e-3)
(equal (abs (- pattern_angle (vla-get-angle line))) (* 1.5 pi) 1e-3)
)
(* 0.5 pi)
)
(
t
(abs (- pattern_angle (vla-get-angle line)))
)
)
line
)
)
line_list
)
)
)
(cond
(
(= (* 0.5 pi) (apply '+ (mapcar 'car angle_line_list)))
(cdr (assoc (* 0.5 pi) angle_line_list))
)
(
(= pi (apply '+ (mapcar 'car angle_line_list)))
(cdr (assoc 0 angle_line_list))
)
(
t
nil
)
)
)
;**************************************************************************************************************************************************
(defun mkOCTlist (MIDCAP SFACT)
(mapcar '(lambda (_angle) (polar MIDCAP _angle SFACT))
(mapcar '*
(list 0 (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4) (/ pi 4))
'(0 1 2 3 4 5 6 7)
);mapcar
);mapcar
)
;**************************************************************************************************************************************************
(defun c:FDM (/ MIDCAP SFACT COUNT tube_lines_sset line_list perpendicular_line intersection_point start_point)
(setvar 'cmdecho 0)
(while
(setvar 'osmode 0)
(setq MIDCAP (getpoint "Select point near cap line : ")
SFACT 0.2
COUNT 0
start_point nil)
(if MIDCAP
(progn
(while (/= COUNT 3)
(setq SFACT (+ SFACT 0.01)
tube_lines_sset (ssget "_CP" (mkOCTlist MIDCAP SFACT) (list (cons 0 "line")))
COUNT (sslength tube_lines_sset))
);while
);progn
);if
(if (and tube_lines_sset
(setq line_list (mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex tube_lines_sset)))))
(= 3 (length line_list))
(setq perpendicular_line (check_angle line_list))
)
(progn
(setq line_list (vl-remove perpendicular_line line_list))
(foreach line line_list
(if (< (distance (vlax-get line 'startpoint)
(setq intersection_point (inters (vlax-get line 'startpoint)
(vlax-get line 'endpoint)
(vlax-get perpendicular_line 'startpoint)
(vlax-get perpendicular_line 'endpoint)
nil
)
)
)
(distance (vlax-get line 'endpoint)
intersection_point
)
)
(vla-put-startpoint line (vlax-3d-point intersection_point))
(vla-put-endpoint line (vlax-3d-point intersection_point))
);if
(if (not start_point)
(setq start_point intersection_point)
);if
);foreach
(vla-put-startpoint perpendicular_line (vlax-3d-point start_point))
(vla-put-endpoint perpendicular_line (vlax-3d-point intersection_point))
);progn
(princ "\nNot three lines selected or they do not hold two parallel lines and one perpendicular line.")
);if
);while
(princ)
)
@dlbsurveysuk wrote:Thanks. Sometimes easy to miss silly mistakes...
sure thing.
i do not quite understand what are going to make of the code. fyi. there is no need three lines intersect with each other at all, they only need to be a pair of parallel lines and one perpendicular to them. the code will adjust lengths of each parallel line to the projected intersection and draw a cap on existing intersection.