# TheSwamp

## Code Red => AutoLISP (Vanilla / Visual) => Topic started by: CatDance on January 10, 2022, 02:19:54 AM

Title: how to entmod the radius of an Arc ?
Post by: CatDance on January 10, 2022, 02:19:54 AM
I know how to entmod the start point and end point of an Arc.
But after entmod the arc's points, the radius of the arc also changed ??

how to entmod the radius of an Arc ?
Title: Re: how to entmod the radius of an Arc ?
Post by: Lee Mac on January 10, 2022, 02:50:16 AM
Do you mean changing the radius without changing the end points?

If the end points can be changed, then simply substitute a new value for group 40 in the DXF data for the ARC entity.
Title: Re: how to entmod the radius of an Arc ?
Post by: CatDance on January 10, 2022, 05:20:23 AM
Do you mean changing the radius without changing the end points?

If the end points can be changed, then simply substitute a new value for group 40 in the DXF data for the ARC entity.

How to find the bulge value if given Arc start point, Arc end point and the Arc radius ?
Is there any Bugle conversion formula ?
Title: Re: how to entmod the radius of an Arc ?
Post by: HOSNEYALAA on January 10, 2022, 07:26:04 AM
hi
pls see this is

http://www.lee-mac.com/bulgeconversion.html
Title: Re: how to entmod the radius of an Arc ?
Post by: ElpanovEvgeniy on January 10, 2022, 11:35:43 AM
Code - Auto/Visual Lisp: [Select]
2. (defun arc-radius (/ GR LST PT)
3.                   ;|
4. *****************************************************************************************
5.
6. by ElpanovEvgeniy
7.
8. Demonstration, educational code
9. The program allows to choose an arc and dynamically to change its diameter,
10. Saving an initial and final angle, and centre point.
11. In the program direct editing DXF of codes of an arc.
12.
14. Last edition       ---
15.
17. *****************************************************************************************
18. |;
19.  (setq lst (entget (car (entsel "\n Select an arc  ")))
20.        pt  (cdr (assoc 10 lst))
21.  ) ;_  setq
22.  (princ "\n Select new radius  ")
23.  (while (and (setq gr (grread 5)) (= (car gr) 5))
24.   (entmod (subst (cons 40 (distance pt (cadr gr))) (assoc 40 lst) lst))
25.   (entupd (cdr (assoc -1 lst)))
26.  ) ;_  while
27. ) ;_  defun
28.
Title: Re: how to entmod the radius of an Arc ?
Post by: Lee Mac on January 10, 2022, 12:09:35 PM
Great to see you posting here again Evgeniy  :-)
Title: Re: how to entmod the radius of an Arc ?
Post by: ElpanovEvgeniy on January 10, 2022, 12:42:29 PM
Great to see you posting here again Evgeniy  :-)

In recent years, I have had little time to write code. I do more management and sometimes train my employees.
Glad to see you in good health!
Title: Re: how to entmod the radius of an Arc ?
Post by: VovKa on January 10, 2022, 03:49:00 PM
In recent years, I have had little time to write code. I do more management and sometimes train my employees.
Glad to see you in good health!
do not forget about us, Евгений
we need some training too ;)
Title: Re: how to entmod the radius of an Arc ?
Post by: CatDance on January 11, 2022, 01:01:56 AM
hi
pls see this is

http://www.lee-mac.com/bulgeconversion.html

I can't access LM website on that day I posted this question. Then LM asked me for clarity of my question and I replied. Then on same day I found the formula for finding the bulge of a arc on a forum and get back to "work" on my coding.
Thanks anyway guys.
Title: Re: how to entmod the radius of an Arc ?
Post by: CatDance on January 11, 2022, 01:02:47 AM
Thanks Evgeniy and LM
Title: Re: how to entmod the radius of an Arc ?
Post by: CatDance on January 11, 2022, 01:04:32 AM
Great to see you posting here again Evgeniy  :-)

In recent years, I have had little time to write code. I do more management and sometimes train my employees.
Glad to see you in good health!

I wonder how CAB is doing ? Where is he now ?