# radius dimension for the selected arcs

## Recommended Posts

Greets
is there any lisp to find the radius dimension for selected arcs in one time?

• Replies 21
• Created

• 9

• 7

• 2

• 1

#### Posted Images

You can simply obtain DXF group 40 for the arcs, e.g.:

```(defun c:test ( / i s )
(if (setq s (ssget '((0 . "ARC"))))
(repeat (setq i (sslength s))
(princ (strcat "\nArc radius: " (rtos (cdr (assoc 40 (entget (ssname s (setq i (1- i)))))))))
)
)
(princ)
)```

##### Share on other sites

Lisp writes the values of the radii of the arcs in the command string, but how to make the dimensions of the arcs in

the drawing? Is it possible to add a circle as well?

Edited by Nikon
##### Share on other sites

So circles exist, do dimensions Program 1 ?

No circles exist add circle and do dims, Program 2 ?

Edited by BIGAL
##### Share on other sites

Circles and arcs exist. Select all and get the radius of all in one time...

The result is as in the picture posted 11.

##### Share on other sites

Thanks, Mr. Lee Mac, but as Mr. Nikon said I need to make the dimensions of the arcs, all arcs at one time, and when you add the circles the lisp will be more amazing.

##### Share on other sites

Untested...

```(defun c:test ( / i s e )
(if (setq s (ssget '((0 . "CIRCLE,ARC"))))
(repeat (setq i (sslength s))
(setq e (ssname s (setq i (1- i))))
(vl-cmdf "_.DIMRAD" e (vlax-curve-getpointatdist e (/ (vlax-curve-getdistatparam e (vlax-curve-getendparam e)) 2.0)))
)
)
(princ)
)```

Edited by marko_ribar

not work

##### Share on other sites

Lisp works great! Thank you very much, marko_ribar! Good luck!

m.alshboul

##### Share on other sites

I have AutoCAD 2024, i don't know what I will do

##### Share on other sites

See in the command line how the Radius command is displayed,

```(defun c:test ( / i s e )
(if (setq s (ssget '((0 . "CIRCLE,ARC"))))
(repeat (setq i (sslength s)) (setq e (ssname s (setq i (1- i))))
(vl-cmdf "DIMRADIUS" e (vlax-curve-getpointatdist e (/ (vlax-curve-getdistatparam e (vlax-curve-getendparam e)) 2.0))) ) )
(princ)
)```

Edited by Nikon
##### Share on other sites

even this not work

##### Share on other sites

have you tried with this?  "_dimradius"

```(defun c:test ( / i s e )
(if (setq s (ssget '((0 . "CIRCLE,ARC"))))
(repeat (setq i (sslength s))
(setq e (ssname s (setq i (1- i))))
(vl-cmdf "_dimradius" e (vlax-curve-getpointatdist e (/ (vlax-curve-getdistatparam e (vlax-curve-getendparam e)) 2.0)))
)
)
(princ)
)```

##### Share on other sites

I bothered you with me, I'm really sorry but this doesn't work

##### Share on other sites

I have AutoCAD 2015 at home, tomorrow at work I will try it in AutoCAD 2020...
Or someone else will tell you...

##### Share on other sites

And to test, if you copy and paste this code directly into the command line?

```((lambda ( / ent dxf_ent)
(while (not (eq ent "eXit"))
(initget "eXit")
(while (null (setq ent (entsel "\nSelect an arc or a circle to dim, [eXit] for quit: "))) (initget "eXit"))
(if (/= ent "eXit")
(progn
(setvar "cmdecho" 0)
(setq dxf_ent (entget (car ent)))
(cond
((eq (cdr (assoc 0 dxf_ent)) "ARC")
)
((eq (cdr (assoc 0 dxf_ent)) "CIRCLE")
)
(T
(princ "\nIsn't an arc or circle!")
)
)
(setvar "cmdecho" 1)
)
)
)
(prin1)
))```

##### Share on other sites

TSUKY does not work in Bricscad V20.

```(command "_.dimdiameter" (cadr ent) "")

_.dimdiameter
Select arc or circle to dimension:
Opposite Corner:
Invalid window specified.
Opposite Corner: nil
Opposite Corner:
Cancel```

NIKON works needs tuning to suit dim style etc, minor issue dwg dependant.

##### Share on other sites

The Tsuky code works in AutoCAD 2020 (Only selects not all objects, but one object),

and what needs to be added to make a full-fledged lisp
(defun c:test...???

Edited by Nikon
##### Share on other sites

thanks Bigal, but this not working as me want

## 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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.

×   Pasted as rich text.   Restore formatting

Only 75 emoji are allowed.