Jump to content

dim radius


kalai

Recommended Posts

i am not able to create radial dim.

code:

(command "circle" '(0 0 0) 100)

(command "dimradius" (entlast) '(200 100 0))

 

i am not getting error but radial dim is not created.

 

help me.

Link to comment
Share on other sites

How about:


(vl-cmdf "_.circle" "_non" '(0 0 0) 100)
(vl-cmdf "_.dimradius"

(ssname (ssget "L") 0)
 '(200 100 0)
 )

Link to comment
Share on other sites

I think perhaps:

 

(command "_.circle" "_non" '(0. 0. 0.) 100.)
(command "_.dimradius" (list (entlast) '(100. 0. 0.)) "_non" '(200. 100. 0.))

Link to comment
Share on other sites

Mine code is working on my end with no problems as well (A2010/2009)

 

Sorry Fixo, yours works too :oops:

 

@kalai: '(100. 0. 0.) is a point on the circle - I would suggest using Fixo's method though.

Link to comment
Share on other sites

sorry fixo,

your code also works

thank you

 

but i have a collection of circles of varying radius to be dimensioned.

how shall i proceed?

 

 

Also i have change the text ht and arrow size?

Link to comment
Share on other sites

Glad if so

You have to create selection set

something like:

(setq sset (ssget (list (cons 0 "circle"))))

then loop through selected items usual way

(while (setq en (ssname sset 0))
(setq elist (entget en)
center (cdr (assoc 10 elist))
rad (cdr (assoc 10 elist)
pt (polar center 0 rad))
(vl-cmdf "_.dimradius"
(ssname (ssget "pt) 0)
pt )
(ssdel en sset)
);end while

Cheers :)

Edited by fixo
code added
Link to comment
Share on other sites

fixo,

 

but i have a collection of circles of varying radius to be dimensioned.

how shall i proceed?

 

 

Also i have change the text ht and arrow size?

Link to comment
Share on other sites

Maybe use:

 

(defun c:test ( / ss i e p r )
 (if (setq ss (ssget '((0 . "CIRCLE"))))
   (repeat (setq i (sslength ss))
     (setq e (ssname ss (setq i (1- i)))
           p (cdr (assoc 10 (entget e)))
           r (cdr (assoc 40 (entget e)))
     )
     (vl-cmdf "_.dimradius" (list e (polar p 0 r)) "_non" (polar p 0 r))
   )
 )
 (princ)
)

Link to comment
Share on other sites

FIXO ,

 

iam getting error at this point,

(vl-cmdf "_.dimradius"

(ssname (ssget "pt) 0)

pt )

pls check,

Sorry I wrote it without editor

Try instead

(defun C:mdrad(/ cp elist en pt rad sset)
(if (setq sset (ssget '((0 . "circle"))))
 (while
   (setq en (ssname sset 0))
   (setq elist (entget en)
  cp (cdr (assoc 10 elist))
  rad (cdr (assoc 40 elist))
  pt (trans (polar cp (/ pi 4) rad) 1 0))
    (vl-cmdf "_.dimradius"
      (ssname (ssget pt '((0 . "circle"))) 0)
      pt
      )
    (ssdel en sset)
   )
 )
(princ)
)

Link to comment
Share on other sites

  • 6 years later...

Now l want creat a lisp using DIMARC with just points.l not want click in arc, l want click just in points.

 

Lee Mac can you help me again?

Link to comment
Share on other sites

if l have

 

(setq list_1(assoc 8 "red"))

 

l can subst

 

(setq list_1(entmod(subst(cons 8 "green")(assoc 8 list_1)list_1)))

 

 

but, how can l subst (10 6433.43 9440.89 0)

(10 0 0 0) ?????

Link to comment
Share on other sites

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.

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

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...