Fillet Multiple Polylines / lines
is there any method to do multiple fillets?
something like this:
in the link exist a lisp do this task but in AutoCAD, do work as expected in BricsCAD.
Comments
-
Try this option 1 only can do option2 by reversing one side list.
; Fillets multi lines in one go
;By Alan H(defun AH:Fmulti ( / ss fpts num num2 x y)
(alert "pick outside-inside-outside")
(setq fpts '())(setq pt1 (getpoint "Pick outside "))
(setq fpts (cons pt1 fpts))
(setq pt1 (getpoint pt1 "Pick inside "))
(setq fpts (cons pt1 fpts))
(setq fpts (cons (getpoint pt1 "Pick outside ") fpts))(setq ss (ssget "F" fpts (list (cons 0 "*LINE"))))
(princ (sslength ss))
(setq num (sslength ss))
(setq num2 (/ num 2.0))
(if (= (- (fix num2) num2) 0.5)
(progn
(Alert "you have an odd number of lines please check")
(exit)
)
)(setq x 0)
(setq y (- num 1))
(setvar "filletrad" 0.0)
(repeat (fix num2) ; not a real
(setq obj1 (ssname ss x))
(setq obj2 (ssname ss y))
(command "fillet" obj1 obj2)
(setq x (+ x 1))
(setq y (- y 1))
)) ; defun
(AH:fmulti)1 -
Thanks a lot
But was necessart change AH by C:
I wish use with your "AH:" how to fix this?
0 -
If you type (AH:Fmulti) after loading it will work. You can make a new defun
(defun c:Fmulti ()(AH:Fmulti)) so when you type fmulti on command line it will run.
A C: means you can type the command following the C:
1 -
onyl curiosly, how did you solved this? i have another lisp that with in AutoCAD, but in BricsCAD always change the SS selection sort, in axis X since left to right and axis Y since below to above, with / without fence
0 -
here I tried change inverse order for "y" option, and tried fix the fence for "pick order" but no luck. any suggestion?
(defun c:tcount_att-add-prefix-suffix-text (/ ss ob start_num inc_num sum ename new_value OLDER error)
(vl-load-com)
(setq OLDER error
error myerror)
(if (setq ss (ssget '((0 . "INSERT"))))
(progn
(initget "X Y Picked")
(setq ob (getkword "\nSort selected objects by [X/Y/Picked-order] <Picked-order>: "))
(cond
((= ob "X")
(setq ss (sort_x ss))
)
((= ob "Y")
(setq ss (sort_y ss))
)
((or (= ob "Picked") (= ob nil))
(setq ss (sort ss))
)
);cond
(setq start_num (getint "\nSpecify starting number <1>: "))
(if (= start_num nil)
(setq start_num 1)
(setq start_num start_num)
);if
(setq inc_num (getint "\nSpecify increment number <1>: "))
(if (= inc_num nil)
(setq inc_num 1)
(setq inc_num inc_num)
);if
(setq sum 0)
(setq sum (apply '+ (list sum start_num)))
(setq ename (entnext (car ss)))
(if (/= (cdr (assoc 0 (entget ename))) "SEQEND") (progn (initget "None Prefix Suffix") (if (/= (cdr (assoc 0 (entget ename))) "SEQEND") (progn (setq ob1 (getkword "\nAdd text with Value to [Prefix/Suffix/None] <None>: ")) (cond ((or (= ob1 "None") (= ob1 nil)) (setq new_value (rtos sum 2 0)) (entmod (subst (cons 1 new_value) (assoc 1 (entget ename)) (entget ename))) (entupd (car ss)) ) ((= ob1 "Prefix") (setq Txt (getstring "\nEnter text for Prefix: ")) (setq new_value (rtos sum 2 0)) (entmod (subst (cons 1 (strcat Txt new_value)) (assoc 1 (entget ename)) (entget ename))) (entupd (car ss)) ) ((= ob1 "Suffix") (setq Txt (getstring "\nEnter text for Suffix: ")) (setq new_value (rtos sum 2 0)) (entmod (subst (cons 1 (strcat new_value Txt)) (assoc 1 (entget ename)) (entget ename))) (entupd (car ss)) ) );cond );progn );if );progn ) (mapcar '(lambda (obj) (setq sum (apply '+ (list sum inc_num))) (setq ename (entnext obj)) (if (/= (cdr (assoc 0 (entget ename))) "SEQEND") (progn (cond ((or (= ob1 "None") (= ob1 nil)) (setq new_value (rtos sum 2 0)) (entmod (subst (cons 1 new_value) (assoc 1 (entget ename)) (entget ename))) (entupd (car ss)) ) ((= ob1 "Prefix") (setq new_value (rtos sum 2 0)) (entmod (subst (cons 1 (strcat Txt new_value)) (assoc 1 (entget ename)) (entget ename))) (entupd (car ss)) ) ((= ob1 "Suffix") (setq new_value (rtos sum 2 0)) (entmod (subst (cons 1 (strcat new_value Txt)) (assoc 1 (entget ename)) (entget ename))) (entupd (car ss)) ) );cond );progn ) ) (cdr ss) ) );progn );if (setq error OLDER)(princ));defun
;;;;;;;;
(defun sort_x (ss / n ss1 )
(setq ss1 nil)
(setq n 0)
(repeat (sslength ss)
(setq ss1 (append ss1 (list (ssname ss n))))
(setq n (1+ n))
);repeat
(setq ss1 (vl-sort ss1 '(lambda (e1 e2) (< (car (cdr (assoc 10 (entget e1))))
(car (cdr (assoc 10 (entget e2))))
)
)
)
);setq
)
;;;;;;;;
(defun sort_y (ss / n ss1 nss)
(setq ss1 nil)
(setq nss (sslength ss))
(setq n (- nss 1))
(repeat (sslength ss)
(setq ss1 (append ss1 (list (ssname ss n))))
(setq n (- n 1))
)
(setq ss1 (vl-sort ss1 '(lambda (e1 e2) (< (cadr (cdr (assoc 10 (entget e1))))
(cadr (cdr (assoc 10 (entget e2))))
)
)
)
);setq
)
;;;;;;;;
(defun sort (sset / n ss1 )
(setq ss1 nil)
(setq n 0)
(repeat (sslength ss)
(setq ss1 (append ss1 (list (ssname ss n))))
(setq n (1+ n))
)
ss1
)
;;;;;;;;;;;;;;;;;;;;;;
(defun myerror (s)(cond
((= s "quit / exit abort") (princ))
((/= s "Function cancelled") (princ (strcat "\nError: " s)))
)
(setq error OLDER)(princ)
)0 -
When you do the sort of X or Y you make a list but I don't think your actually returning ss1 to the SS variable, but that also switches from a selection set to a list a different problem. Try changing the sortx defun by adding a (princ ss1) at end. Run the code by copy pasting to command line and check that (sortx is working.
Why not just do (sort_x ss) dont do the setq and make the ss1 a local variable of the master defun.
I did not try running the code.
1