View Full Version : circumferebtial dimension
indycel
2005-02-13, 12:49 AM
I had a problem with tagging circumference with dimension. the AutoCAD 2002 does not have a feature that could tag circumference with dimension. Does anyone had a LISP that could put dimension on a circumference with out having to resolve it first to polyline, offsetting it and then put a dimension using the offsetted polyline?
Romy aguilar
kennet.sjoberg
2005-02-14, 09:31 AM
Here is something for You to start with
(defun c:CF (/ Ent Obj Circum chk Pkt )
;;; Program that use dimradius to show Circumference
(if (setq Ent (entsel "\nCommand: Select a Circle : " ) )
(progn
(if (= "CIRCLE" (cdr (assoc 0 (entget (car Ent )))) )
(progn
(vl-load-com)
(setq Obj (vlax-ename->vla-Object (car Ent )) )
(setq Circum (vlax-get Obj "Circumference" ) )
(setq Pkt (getpoint "and place the dimension" ) )
(setq chk (entlast) ) ;; check if dim will be created
(command "._dimradius" Ent Pkt )
(if (not (equal chk (entlast) ))
(progn
(setq Obj (vlax-ename->vla-Object (entlast)) )
(setq Circum (strcat "CF = " (rtos Circum 2 3 )) ) ;; 3 = precision
(vlax-put-property Obj "TextOverride" Circum )
(vlax-release-Object Obj )
)
(princ ". . . No dimension created !" )
)
)
(princ "Object was not a circle !" )
)
)
(princ "Miss, aim better !" )
)
(princ)
)
: ) Happy Computing !
kennet
indycel
2005-02-15, 03:32 AM
Thank you very much Kennet. I already load it to Acad Support but I have the problem of running it, can I ask again your favor?
kennet.sjoberg
2005-02-15, 08:52 AM
What happens if You mark and copy [Ctrl+C] the function in the forum from the line
(defun c:Cf.... to the last line
..
..
)
and paste it in to AutoCADs Command window ( Yes )
Command: [Ctrl+V] and [Enter], and then type the CF as a new command ?
Command: CF
-------------------------------------------------------------------------------------
If that works You have loading problem and have to make a file ( use notepad ) and paste the text from the forum in to it.
Save the file as CF.lsp in AutoCADs Support File Search Path, or in Your private folder.
Then You must tell AutoCAd to load that file, You can do it in acad.lsp or any other startup files,
use load if the function allways must be loaded
(load "CF.lsp")
use autoload if the function will be loaded when typing the command CF
(autoload "CF.lsp" '("CF"))
if the file is not in AutoCADs Support File Search Path You must tell AutoCAD where the file is, like
(load "C:\\Documents and Settings\\Kennets\\blabla\\CF.lsp" )
Then when AutoCAD start it run the starup file that load the lisp file
and then You have to run the Command: CF
----------------------
You can also try to load and run the file manually by typing ( use Your path )
Command: (load "C:\\Documents and Settings\\Kennets\\blabla\\CF.lsp" )
Command: CF
: ) Happy Computing !
kennet
indycel
2005-02-15, 10:12 AM
thank you again very much kennet
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.