Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Valued Contributor
harrison071004
Posts: 90
Registered: ‎01-21-2007
Message 1 of 4 (228 Views)

Distance between 2 circles on arc

228 Views, 3 Replies
01-22-2008 04:17 PM
Hello. I'm trying to figure out a way to get a distance between two circles on a arc. I won't be able to do the distance command b/c that is not accurate b/c of the arc. If I trim the lines outside the circles I end up with 21 feet but I don't want to have do that...please see attached
*Doug Broad
Message 2 of 4 (228 Views)

Re: Distance between 2 circles on arc

01-22-2008 04:37 PM in reply to: harrison071004
Those are points on the arc, not circles.

This will create a dimarc which measures the distance and annotates it.

(prompt "\nSelect the arc, points on the arc, and then dimension line location.")
(command "dimarc" "nea" pause "partial" "nod" pause "nod" pause)

You could also create a program that utilizes the functions:

entsel
vlax-ename->vla-object
vlax-curve-getparamatpoint
vlax-curve-getdistatparam



wrote in message news:5827455@discussion.autodesk.com...
Hello. I'm trying to figure out a way to get a distance between two circles on a arc. I
won't be able to do the distance command b/c that is not accurate b/c of the arc. If I
trim the lines outside the circles I end up with 21 feet but I don't want to have do
that...please see attached
Valued Contributor
harrison071004
Posts: 90
Registered: ‎01-21-2007
Message 3 of 4 (228 Views)

Re: Distance between 2 circles on arc

01-22-2008 04:48 PM in reply to: harrison071004
Yes, sorry your right they are points not circles.
That sounds what I need exactly, BUT I'm not sure what you provided me..was that a lisp routine? If so would you be able to send me the actual file I have no clue how to "type" a lisp routine. Thanks in advance!
*Tony Tanzillo
Message 4 of 4 (228 Views)

Re: Distance between 2 circles on arc

01-22-2008 08:25 PM in reply to: harrison071004
Put this in a text file and save it with a .LSP
extension, somewhere in your AutoCAD search
path:

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;
;;;; brklen.lsp (c) 2002 www.caddzone.com
;;;; Adds the BRKLEN command to AutoCAD, that
;;;; displays the length of the segment of a curve
;;;; between two break points. the curve can be a
;;;; spline, polyline, arc, circle, line, ellipse, etc..)
;;;;
;;;; First pick the curve, then pick the two points
;;;; on the curve that you want to measure between.
;;;;
;;;; Standard caveat: minimal error checking done.

(defun C:BRKLEN (/ p1 p2 ent curve pc1 pc2 result )
(if
(and
(setq ent (entsel "\nCurve to measure along: "))
(setq p1 (getpoint "\nMeasure from point: "))
(setq p2 (getpoint " To point: "))
(setq curve (car ent))
)
(vl-catch-all-apply
'(lambda ()
(setq pc1 (vlax-curve-getclosestpointto curve p1))
(setq pc2 (vlax-curve-getclosestpointto curve p2))
(setq result
(abs
(- (vlax-curve-getdistatpoint curve pc1)
(vlax-curve-getdistatpoint curve pc2)
)
)
)
)
)
)
(if result
(princ (strcat "\nLength: " (rtos result)))
(princ "\nError or invalid selection.")
)
(princ)
)

;;;;;;;;;;;;;;;;;;;;;;; brklen.lsp ;;;;;;;;;;;;;;;;;;;;;;;;;;;;
--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5827455@discussion.autodesk.com...
Hello. I'm trying to figure out a way to get a distance between two circles on a arc. I won't be able to do the distance command b/c that is not accurate b/c of the arc. If I trim the lines outside the circles I end up with 21 feet but I don't want to have do that...please see attached
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.