m.alshboul Posted November 18 Share Posted November 18 Greets is there any lisp to find the radius dimension for selected arcs in one time? Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted November 18 Share Posted November 18 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) ) Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 18 Share Posted November 18 (edited) 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 November 18 by Nikon Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 19 Share Posted November 19 (edited) So circles exist, do dimensions Program 1 ? No circles exist add circle and do dims, Program 2 ? Explain more details please. Edited November 19 by BIGAL Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 19 Share Posted November 19 Circles and arcs exist. Select all and get the radius of all in one time... The result is as in the picture posted 11. Quote Link to comment Share on other sites More sharing options...
m.alshboul Posted November 19 Author Share Posted November 19 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. Quote Link to comment Share on other sites More sharing options...
marko_ribar Posted November 19 Share Posted November 19 (edited) 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 November 19 by marko_ribar Quote Link to comment Share on other sites More sharing options...
m.alshboul Posted November 19 Author Share Posted November 19 not work Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 19 Share Posted November 19 Lisp works great! Thank you very much, marko_ribar! Good luck! Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 19 Share Posted November 19 m.alshboul Specify the command for your version of AutoCAD, you may need to change "_.DIMRAD" to "_dimradius" or another variant. Quote Link to comment Share on other sites More sharing options...
m.alshboul Posted November 19 Author Share Posted November 19 I have AutoCAD 2024, i don't know what I will do Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 19 Share Posted November 19 (edited) In AutoCAD, create a radius. At the command prompt, type r (Radius) See in the command line how the Radius command is displayed, copy and paste into lisp instead of "_.DIMRAD" (perhaps "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) ) Edited November 19 by Nikon Quote Link to comment Share on other sites More sharing options...
m.alshboul Posted November 19 Author Share Posted November 19 even this not work Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 19 Share Posted November 19 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) ) Quote Link to comment Share on other sites More sharing options...
m.alshboul Posted November 19 Author Share Posted November 19 I bothered you with me, I'm really sorry but this doesn't work Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 19 Share Posted November 19 I have AutoCAD 2015 at home, tomorrow at work I will try it in AutoCAD 2020... Or someone else will tell you... 1 Quote Link to comment Share on other sites More sharing options...
Tsuky Posted November 19 Share Posted November 19 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") (command "_.dimradius" (cadr ent) "") ) ((eq (cdr (assoc 0 dxf_ent)) "CIRCLE") (command "_.dimdiameter" (cadr ent) "") ) (T (princ "\nIsn't an arc or circle!") ) ) (setvar "cmdecho" 1) ) ) ) (prin1) )) Quote Link to comment Share on other sites More sharing options...
BIGAL Posted November 20 Share Posted November 20 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. Quote Link to comment Share on other sites More sharing options...
Nikon Posted November 20 Share Posted November 20 (edited) 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 November 20 by Nikon Quote Link to comment Share on other sites More sharing options...
m.alshboul Posted November 20 Author Share Posted November 20 thanks Bigal, but this not working as me want Quote Link to comment Share on other sites More sharing options...
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.