Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Circumference Dimension

9 REPLIES 9
Reply
Message 1 of 10
Anonymous
473 Views, 9 Replies

Circumference Dimension

Does any one have a routine that will dimension for a Circumference that you would share?

I know that the circumference can be obtained in the properties box, however it would be nice if it were associative.

By the way I use A2K4

Thanks in advanced.
9 REPLIES 9
Message 2 of 10
Anonymous
in reply to: Anonymous

Well, you probably don't want a circular dimension line all around the circle, so how about a leader with the number attached: (defun C:circu( / circ circrad circumstr) ;dimension circumference (setq circ (entsel "\nSelect a Circle: ")) (setq circrad (cdr(assoc 40(entget(car circ))))) (setq circumstr (strcat "Circumference = " (rtos(* 2 pi circrad)))) (setq p1(getpoint "Arrow point: ")) (setq p2(getpoint p1 "Dimension location: ")) (command "qleader" p1 p2 circumstr "") (princ)) No safeguards. rs --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/3/2004
Message 3 of 10
Anonymous
in reply to: Anonymous

Actually, I like this just a bit better: (defun C:circu( / circumstr) ;dimension circumference (setq circumstr (strcat "Circumf. = " (rtos(* 2 pi (cdr(assoc 40 (entget(car(entsel "\nSelect a Circle: ")))))))) ) (command "leader" (getpoint "Arrow point: ") (getpoint (getvar "lastpoint") "Dimension location: ") "" circumstr "") (princ)) rs --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.698 / Virus Database: 455 - Release Date: 6/3/2004
Message 4 of 10
Anonymous
in reply to: Anonymous

Charlie, This should work most of the time. Be sure to set dimassoc = 2. (defun c:circum( / ) ;;D. C. Broad, 6/5/2004 - Circumference dimension (command "dim1" "rad" pause "Circ: <>" "exit") (command "dimoverride" "dimlfac" (* 2 pi) "" "last" "") (Princ)) "Charliep" wrote in message news:13052638.1086363817589.JavaMail.javamailuser@localhost... > Does any one have a routine that will dimension for a Circumference that you would share? > > I know that the circumference can be obtained in the properties box, however it would be nice if it were associative. > > By the way I use A2K4 > > Thanks in advanced.
Message 5 of 10
Anonymous
in reply to: Anonymous

Excelente Doug.... "Doug Broad" escribió en el mensaje news:40c1c3b3$1_3@newsprd01... > Charlie, > This should work most of the time. Be sure to set dimassoc = 2. > > (defun c:circum( / ) > ;;D. C. Broad, 6/5/2004 - Circumference dimension > (command "dim1" "rad" pause "Circ: <>" "exit") > (command "dimoverride" "dimlfac" (* 2 pi) > "" "last" "") > (Princ)) > > > "Charliep" wrote in message news:13052638.1086363817589.JavaMail.javamailuser@localhost... > > Does any one have a routine that will dimension for a Circumference that you would share? > > > > I know that the circumference can be obtained in the properties box, however it would be nice if it were associative. > > > > By the way I use A2K4 > > > > Thanks in advanced. > >
Message 6 of 10
Anonymous
in reply to: Anonymous

Thank you José. "José Luis Garcia Galán" wrote in message news:40c247bc_1@newsprd01... > Excelente Doug.... >
Message 7 of 10
Anonymous
in reply to: Anonymous

Hi Doug Excellent idea... may be improved a little bit: (defun C:Circum ( / OldCmd OldDas) ;;D. C. Broad, 6/5/2004 - Circumference dimension (setq OldDas (getvar "DIMASSOC") OldCmd (getvar "CMDECHO") ) (setvar "DIMASSOC" 2) ;ensure associative dim (setvar "CMDECHO" 1) ;ensure prompts (command "_.DIM1" "_RAD" pause "" pause ;drag dim to position "_.DIMOVERRIDE" "DIMPOST" "Circ: <>" ;remove 'R' from dim "DIMLFAC" (* 2 pi) "" "_LAST" "" ) (setvar "DIMASSOC" OldDas) (setvar "CMDECHO" OldCmd) (princ) ) Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
Message 8 of 10
Anonymous
in reply to: Anonymous

Excellent changes Juerg. I added some final polishing: Thanks! [code] (defun c:circum( / oce oda *error*) ;;D. C. Broad, 6/5/2004 Circumference of a circle ;;With changes designed by Juerg Menzi on 6/6/2004 ;;Dimassoc should be set to 2 (setq oce (getvar "cmdecho") oda (getvar "dimassoc")) (defun *error* (msg) (setvar "cmdecho" oce) (setvar "dimassoc" oda) (if msg (princ msg)) (princ)) (setvar "cmdecho" 1) (setvar "dimassoc" 2) (command "_.dim1" "_.rad" pause "" pause) (setvar "cmdecho" 0) (command "_.dimoverride" "dimlfac" (* 2 pi) "dimpost" "Circ: <>" "" "_last" "") (*error* nil)) [/code] "Jürg Menzi" wrote in message news:40C30160.EBA53CA@menziengineering.ch... > Hi Doug > > Excellent idea... may be improved a little bit: > > (defun C:Circum ( / OldCmd OldDas) > ;;D. C. Broad, 6/5/2004 - Circumference dimension > (setq OldDas (getvar "DIMASSOC") > OldCmd (getvar "CMDECHO") > ) > (setvar "DIMASSOC" 2) ;ensure associative dim > (setvar "CMDECHO" 1) ;ensure prompts > (command "_.DIM1" "_RAD" pause "" pause ;drag dim to position > "_.DIMOVERRIDE" "DIMPOST" "Circ: <>" ;remove 'R' from dim > "DIMLFAC" (* 2 pi) > "" "_LAST" "" > ) > (setvar "DIMASSOC" OldDas) > (setvar "CMDECHO" OldCmd) > (princ) > ) > > Cheers > -- > Juerg Menzi > MENZI ENGINEERING GmbH, Switzerland > http://www.menziengineering.ch
Message 9 of 10
Anonymous
in reply to: Anonymous

Hi Doug Good points... - Normally I never use this kind of error handler because I've one in my common functions: (defun... (MeStartProc '("SYSVAR1"... "SYSVARn")) ;stores sysvars etc... ...Code (MeEndProc) ) For a standalone function you've chosen the correct way. - Suppressing prompts for "_.dimoverride" - as it must be. Cheers -- Juerg Menzi MENZI ENGINEERING GmbH, Switzerland http://www.menziengineering.ch
Message 10 of 10
Anonymous
in reply to: Anonymous

Many thanks to all who offered solutions. I have not tried all of the options that you gave me, but the ones I have tried have been what I needed.
Again THANKS!!!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost