Nikon Posted August 1, 2024 Posted August 1, 2024 There is a program Kent Cooper, but unfortunately it doesn't work. I choose a circle (or an arc). It ends with an error... Please tell me where the error is. (defun C:FMR (/ aper pt); = Fillet Match Radius [of existing curve] ; to apply the radius of a selected curved object in the Fillet command ; Kent Cooper, June 2011 (setq aper (getvar 'aperture)) (while (not (setq pt (cadr (entsel "Select curve to set Fillet Radius: ")))) (prompt "\nNothing selected -- ") ); end while (setvar 'aperture (getvar 'pickbox)); ensures Osnap won't "see" wrong thing (if (osnap pt "cen") (setvar 'filletrad (distance (osnap pt "nea") (osnap pt "cen"))); then (progn ; else (prompt "\nNo radius for that object.") (setvar 'aperture aper) (exit) ); end progn ); end if (setvar 'aperture aper) (command "_.fillet" "_mUltiple") (princ) ) ; Select curve to set Fillet Radius: ; No radius for that object.; error: end/exit abort Quote
SLW210 Posted August 1, 2024 Posted August 1, 2024 Kent Cooper is active on the Autodesk Forums. 1 Quote
CyberAngel Posted August 1, 2024 Posted August 1, 2024 The only way the function can produce that error message is if the object chosen has no center point. It won't reach that test until you've selected an object of some kind--not necessarily an arc/circle. Can't diagnose it any better until we know what you're picking. Note that the aperture changes while the function is active. Quote
Nikon Posted August 2, 2024 Author Posted August 2, 2024 10 hours ago, CyberAngel said: The only way the function can produce that error message is if the object chosen has no center point. It won't reach that test until you've selected an object of some kind--not necessarily an arc/circle. The program asks me to select a curve to indicate the radius of the fillet, I select a circle, but the program ends... Quote
Tharwat Posted August 2, 2024 Posted August 2, 2024 A quick example written from Mobile. (setq obj (car (entsel "\nSelect circle:"))) (setvar 'filletrad (cdr(assoc 40 (entget obj)))) 1 Quote
Tsuky Posted August 2, 2024 Posted August 2, 2024 And if you internationalize the parameters of (osnap) "cen" -> "_cen" "near" -> "_near" This might work! Otherwise you can try this: (defun c:set_fillet ( / ent dxf_ent typ_ent mkv vector vlaobj id_rad) (while (not (setq ent (entsel "Select curve to set Fillet Radius: ")))) (setq typ_ent (cdr (assoc 0 (setq dxf_ent (entget (car ent)))))) (cond ((or (eq typ_ent "ARC") (eq typ_ent "CIRCLE") (eq typ_ent "LWPOLYLINE") (and (eq typ_ent "POLYLINE") (zerop (boole 1 120 (cdr (assoc 70 dxf_ent)))) ) ) (if (or (> (fix (car (trans (cadr ent) 1 0))) 1E6) (> (fix (cadr (trans (cadr ent) 1 0))) 1E6)) (setq mkv T vector (trans (cadr ent) 0 0 T) vlaobj (vlax-ename->vla-object (car ent))) (setq mkv nil) ) (if mkv (vla-move vlaobj (vlax-3d-point (trans (cadr ent) 1 0)) (vlax-3d-point '(0.0 0.0 0.0)))) (setq id_rad (distance '(0 0) (trans (vlax-curve-getsecondderiv (car ent) (vlax-curve-getparamatpoint (car ent) (vlax-curve-getclosestpointto (car ent) (if mkv '(0.0 0.0 0.0) (trans (cadr ent) 1 0))) ) ) 0 (car ent) T ) ) ) (if mkv (vla-move vlaobj (vlax-3d-point '(0.0 0.0 0.0)) (vlax-3d-point vector))) (setvar "FILLETRAD" (abs id_rad)) ) (T (setvar "FILLETRAD" 0.0)) ) (command "_.fillet" "_multiple") (prin1) ) 1 Quote
Nikon Posted August 2, 2024 Author Posted August 2, 2024 (edited) 38 minutes ago, Tsuky said: And if you internationalize the parameters of (osnap) "cen" -> "_cen" "near" -> "_near" This might work! ; by Kent Cooper (defun C:FMR (/ aper pt); = Fillet Match Radius [of existing curve] ; to apply the radius of a selected curved object in the Fillet command ; Kent Cooper, June 2011 (setq aper (getvar 'aperture)) (while (not (setq pt (cadr (entsel "Select curve to set Fillet Radius: ")))) (prompt "\nNothing selected -- ") ); end while ;(setq obj (car (entsel "\nSelect circle:"))) ;(setvar 'filletrad (cdr(assoc 40 (entget obj)))) (setvar 'aperture (getvar 'pickbox)); ensures Osnap won't "see" wrong thing (if (osnap pt "_cen") (setvar 'filletrad (distance (osnap pt "_nea") (osnap pt "_cen"))); then (progn ; else (prompt "\nNo radius for that object.") (setvar 'aperture aper) (exit) ); end progn ); end if (setvar 'aperture aper) (command "_.fillet" "_mUltiple") (princ) ) Now this code is working! @Tsuky THANK YOU VERY MUCH! "set_fillet" works very well! Edited August 2, 2024 by Nikon 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.