amook147 Posted January 30 Posted January 30 Drawing2.dwg As shown in the figure below: Select multiple graphics in batch and change the R value from 0.2 to another value? Quote
SLW210 Posted January 30 Posted January 30 Are you looking for a LISP, Python, VBA, .NET, etc.? I moved your thread to the AutoLISP, Visual LISP & DCL Forum. Quote
BIGAL Posted January 30 Posted January 30 Code what's that for ? Join Fillet R 0.4 P pickobject enter All done 1 Quote
mhupp Posted January 31 Posted January 31 1 hour ago, BIGAL said: Code what's that for ? Join Fillet R 0.4 P pickobject enter All done Have to fillet the 3 long arcs segments before joining. But yes no lisp needed for simple task. Quote
BIGAL Posted January 31 Posted January 31 (edited) The large arc is like the base radius for all the teeth, so changing that may need a complete redraw. behind the shape must be some form of formula, or design rules. Sounds like a custom gear.lsp is needed. Edited January 31 by BIGAL Quote
Tsuky Posted February 2 Posted February 2 @amook147 Try this With your exemple seem to work's... mdf_gear.lsp 1 Quote
SLW210 Posted February 3 Posted February 3 Much like Elvis, the OP seems to have left the building. In case there is a dramatic return, here is a LISP that should work, though unclear what "code" they want or or if this is for an actual plug-in. Solved: Fillet multiple polyline all at once by lisp - Autodesk Community I didn't look at Kent Cooper's version to prompt for a radius, but used the original and added something simple to it. I am sure Kent Cooper's is better. (defun C:FMP_R (/ plss n rad) (setq rad (getdist "\nEnter fillet radius: ")) (if (and rad (> rad 0.0)) (progn (command "_.fillet" "_radius" rad) (if (setq plss (ssget "_:L" '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ) ) ) ) (princ) ) 1 Quote
Nikon Posted February 3 Posted February 3 (edited) Lee Mac has a similar code. The FMP_R and fpoly codes perform conjugations with a given radius. Only in these codes it is impossible to set the value radius = 0. Is there a code for interfacing with a radius of 0? There's also the marko_ribar code, but I couldn't verify it. When loading, the message appears: Unknown command. Edited February 3 by Nikon Quote
SLW210 Posted February 4 Posted February 4 Did you bother to check the link I posted? The first one in my link from Kent Cooper will do fillet>R>0 if that is the value of FILLETRAD. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166#M130031 The FilletMultiplePolylines will work with 0 radius. https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/10151411#M130041 Quote
Nikon Posted February 4 Posted February 4 1 hour ago, SLW210 said: Did you bother to check the link I posted? Unfortunately, I couldn't check, the link doesn't open for me... Quote
Nikon Posted February 4 Posted February 4 4 hours ago, SLW210 said: https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/6473166#M130031 Can anyone attach a lisp from this link? Quote
GLAVCVS Posted February 4 Posted February 4 (defun C:FMP (/ plss n) (if (setq plss (ssget '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ); repeat ); if (princ) I guess this is it 1 Quote
Nikon Posted February 4 Posted February 4 (edited) 1 hour ago, GLAVCVS said: (defun C:FMP (/ plss n) (if (setq plss (ssget '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ); repeat ); if (princ) This code should perform the pairing (without specifying the radius?). The code doesn't work: unknown command. The parenthesis after (princ) is lost. +) Edited February 4 by Nikon Quote
Nikon Posted February 4 Posted February 4 (edited) 6 hours ago, SLW210 said: The first one in my link from Kent Cooper will do fillet>R>0 if that is the value of FILLETRAD. The code can connect several polylines with a radius of 0. I understood that FILLETRAD must be set beforehand. Or do this: (defun C:FMP0 ; = Fillet Multiple Polylines (/ plss n) (setvar "FILLETRAD" 0) (if (setq plss (ssget '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ); repeat ); if (princ) ); defun Or a different code for different radii, and you can also use 0. (defun C:FMP01 (/ rad plss n) (setq rad (getreal " Enter the fillet radius (you can use 0): ")) (setvar "FILLETRAD" rad) (if (setq plss (ssget '((0 . "LWPOLYLINE")))) (repeat (setq n (sslength plss)) (command "_.fillet" "_polyline" (ssname plss (setq n (1- n)))) ) ) (princ) ) Edited February 4 by Nikon Quote
GLAVCVS Posted February 4 Posted February 4 1 hour ago, Nikon said: This code should perform the pairing (without specifying the radius?). The code doesn't work: unknown command. The parenthesis after (princ) is lost. +) Phew! I just copied and pasted from the link you requested. For some reason, the final parenthesis got lost. But I see that the code suggested here is already more complete. Deprecated! 1 Quote
SLW210 Posted February 4 Posted February 4 Here is the one from Kent Cooper, though it seems suspicious you would be blocked from the Autodesk Forums. This is the one that asks for the radius and will accept 0 radius. ;| FilletMultiplePolylines.lsp [command name: FMP] Asks for desired Fillet radius, offering default of prior value if present, otherwise regular Fillet's value, as default. Asks for selection of Polylines, and Fillets all possible corners at specified radius. Restores regular Fillet's radius setting, but stores setting from this command separately, for default on subsequent use. Works on LightWeight and "heavy" 2D Polylines except those that are Fit- or Spline-curved. Accepts selection of those, and of 3D Polylines, but does not process them. |; ;;; ;;; By Kent Cooper ;;; ;;; Found here https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/fillet-multiple-polyline-all-at-once-by-lisp/m-p/10151411#M130041 (defun C:FMP ; = Fillet Multiple Polylines (/ *error* doc filr plss n pl) (defun *error* (errmsg) (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break")) (princ (strcat "\nError: " errmsg)) ); if (setvar 'filletrad filr); reset (vla-endundomark doc) (princ) ); defun - *error* (vla-startundomark (setq doc (vla-get-activedocument (vlax-get-acad-object)))) (setq filr (getvar 'filletrad)); save current setting (initget 4); no negative (setq *fmpr* ; global variable (cond ( (getdist (strcat "\nRadius for Filleting all Polyline corners <" (rtos (cond (*fmpr*) ((getvar 'filletrad)))) ; prior value as default if present; if not, regular Fillet radius ">: " ); strcat ); getdist ); User-input condition (*fmpr*); prior value if present on Enter ((getvar 'filletrad)); regular Fillet radius if no prior value on Enter ); cond ); setvar (setvar 'filletrad *fmpr*) (if (setq plss (ssget "_:L" '((0 . "*POLYLINE")))) (repeat (setq n (sslength plss)) (setq pl (ssname plss (setq n (1- n)))) (if (= (logand (cdr (assoc 70 (entget pl))) 30) 0); not 3D, fit- or spline-curved (command "_.fillet" "_polyline" pl); then ); if ); repeat ); if (setvar 'filletrad filr) (vla-endundomark doc) (princ) ); defun (vl-load-com) (prompt "\nType FMP to Fillet Multiple Polylines.") 1 Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.