Multiple fillet - Radius 0 / Radius (value)

Multiple fillet - Radius 0 / Radius (value)

Lukasvop1
Advocate Advocate
1,803 Views
22 Replies
Message 1 of 23

Multiple fillet - Radius 0 / Radius (value)

Lukasvop1
Advocate
Advocate

Hi guys, can you write 2 simple lisps that allow quick Multiple Fillet

(I mean without pressing enter after use command Fillet) (in 2D/3D) :


F0 - Multiple - Fillet - Radius [0]
FR - Multiple - Fillet - Radius [User_add_value]

 

Multiple filler F0, FR.png

0 Likes
Accepted solutions (2)
1,804 Views
22 Replies
Replies (22)
Message 2 of 23

ВeekeeCZ
Consultant
Consultant

Really, not capable of something that simple... geez

0 Likes
Message 3 of 23

Lukasvop1
Advocate
Advocate

Yep, I wrote 2 "simple" lisps.. I know it's trivial for you.

0 Likes
Message 4 of 23

ВeekeeCZ
Consultant
Consultant

No, it is trivial for anybody. Just basic scripting.

0 Likes
Message 5 of 23

Lukasvop1
Advocate
Advocate

Well, but I know nothing about scripning.  That's the point..

0 Likes
Message 6 of 23

ВeekeeCZ
Consultant
Consultant

Yeah, you know nothing. What a great excuse.

All you should need to know is that it's powerful enough and easy to learn. Period. 

0 Likes
Message 7 of 23

Kent1Cooper
Consultant
Consultant

Since I already have something I've used for years for the zero-radius version, that is attached.  It restores whatever the current Fillet radius setting was, after it's done.

 

Study the functions involved in the AutoLisp Reference, and also look at (getdist), and you should be able to figure out how to adapt it for a User-input radius.

Kent Cooper, AIA
Message 8 of 23

komondormrex
Mentor
Mentor
Accepted solution

hey there,

for lwplines

(defun c:f0 nil
	(mapcar '(lambda (pline) (vl-cmdf "_fillet" "_p" "_r" 0 pline))
			 (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "lwpolyline"))))))
	)
	(princ)
)

(defun c:fr (/ radius)
	(mapcar '(lambda (pline) (vl-cmdf "_fillet" "_p" "_r" 
									  (if (null (setq radius (if (null radius) (getreal (strcat "\nEnter radius to fillet with <" (rtos (getvar 'filletrad)) ">: ")) radius)))
										  (setq radius (getvar 'filletrad))
										  radius
									  )
									  pline
							 )
			 )
			 (vl-remove-if 'listp (mapcar 'cadr (ssnamex (ssget '((0 . "lwpolyline"))))))
	)
	(princ)
)
Message 9 of 23

Lukasvop1
Advocate
Advocate

Thank you

0 Likes
Message 10 of 23

Lukasvop1
Advocate
Advocate

But something is wrong, I can't select object (Line/PLine).

0 Likes
Message 11 of 23

komondormrex
Mentor
Mentor

you mean selecting in pairs line/pline - line/pline?

0 Likes
Message 12 of 23

Lukasvop1
Advocate
Advocate

For example, but I can't select Line at all, and when select PLine nothing happend.. 

0 Likes
Message 13 of 23

ВeekeeCZ
Consultant
Consultant
Accepted solution

If you keep on blindly adopting advanced codes, then you will never learn anything.

This is what I had in mind. 

 

(defun c:f0 ()
  (command "filletrad" 0)
  (command-s "fillet" "u")
  (princ)
  )

(defun c:fr ()
  (command "filletrad" pause)
  (command-s "fillet" "u")
  (princ)
  )

 

Message 14 of 23

Lukasvop1
Advocate
Advocate

Yes, this is exactly I wanted.

0 Likes
Message 15 of 23

Lukasvop1
Advocate
Advocate

But I've no idea how you get this..

0 Likes
Message 16 of 23

Kent1Cooper
Consultant
Consultant

You may be interested in FilletMult.lsp, >here<.  It defines an F0 command that works the same as my FZ command posted earlier.  And it defines F1 through F9 commands in which you can set whatever radius values you want, if you have radii that you use regularly.  Each one lets you Fillet as many things of as many different kinds as you want, and remembers the value set in it, to offer as default on subsequent use, even after exiting AutoCAD completely.  So you can set [for example] 215.3594 as a radius into [for example] the F8 command, Fillet things with it and conclude, and next time you want to Fillet things at that radius, just type in F8, and it will offer that as the default, so you don't need to enter it again.  [And you can change the value in any of them any time by entering something instead of accepting the offered default.]  And they all restore whatever regular Fillet's radius setting was, after you use them.  You would want to keep a list somewhere of what radii you have set for each command.

Kent Cooper, AIA
0 Likes
Message 17 of 23

komondormrex
Mentor
Mentor

well, it was intended for having at least two segments lwplines only.

check another ones.

(defun c:f0 nil
	(setvar 'filletrad 0)
	(while (null (command-s "_fillet")))
)

(defun c:fr (/ radius)
  	(if (setq radius (if (null radius) 
						(getreal (strcat "\nEnter radius to fillet with <" (rtos (getvar 'filletrad)) ">: ")) 
						(getvar 'filletrad)
					 )
		)
  		  (setvar 'filletrad radius)
	)
  	(while (null (command-s "_fillet")))
)
Message 18 of 23

ВeekeeCZ
Consultant
Consultant

He will not like you for this.

(while (null (command-s ...)))

0 Likes
Message 19 of 23

ВeekeeCZ
Consultant
Consultant

@Lukasvop1 wrote:

But I've no idea how you get this..


 

Of course not, because you know nothing.

 

https://www.youtube.com/watch?v=JS5ThafEpFs

Message 20 of 23

Lukasvop1
Advocate
Advocate

Thank you, this is great starting point of scripting lisp.

0 Likes