AC2Designs Posted January 26, 2010 Posted January 26, 2010 Does anyone know how to do this, or at least point me in the right direction? I actually have 2 situations: 1. I need to be able to draw and arc, programmatically, knowing only the start pt, end pt, and radius. I know there is a formula radius = sq.rt of (x1-x2)xc + (y1-y2)yc, or something like that...but have no idea where to start... 2. sometimes the start and end points will be connected and I will need to fillet, or adjust the lines accordingly and then draw the arc. Make sense? any help is appreciated. Quote
LEsq Posted January 26, 2010 Posted January 26, 2010 The command ARC have already a built option Start-End-Radius, have a look under the Draw pull-down menu - Arc i.e.- (command "arc" (getpoint "\nStart: ") (getpoint "\nEnd: ") (getdist "\nRadius: ")) or, maybe... as start up and not tested at all... (defun C:SER (/ sp ep d r) (setq sp (getpoint "\nStart point: ") ep (getpoint "\nEnd point: ") d (/ (distance sp ep) 2) ) (while (< (setq r (getdist "\nRadius: ")) d) (prompt (strcat "\nRadius must be greater than " (rtos d 2 3)) ) ) (vl-cmdf "_.ARC" sp "_E" ep "_R" r) (princ) ) Quote
David Bethel Posted January 26, 2010 Posted January 26, 2010 First off I think that you will to verify that (* radius 2.) is greater the the distance from the start point to the end point. If that is true, I think that will always be 2 correct results. 1 > 180 and 1 If the start point and end points are coincidental, then an arc cannot be formed. Only a circle then. -David I see Luis has addressed some of these Quote
AC2Designs Posted January 26, 2010 Author Posted January 26, 2010 Thanks guys. I'll look at using Lisp. The rest of my project is in VBA, is there a way to access Lisp commands from VBA; other than SendCommand, or is that the best method? I also need to populate LSP variables with data from VBA. Is this possible? Quote
LEsq Posted January 26, 2010 Posted January 26, 2010 i don't eat vba... tried many moons ago never like it, does not taste good at least for me... and remember, that it will taken out of the table, the menu nowadays includes more tasteful plates, to choose. give it a try. Quote
AC2Designs Posted January 26, 2010 Author Posted January 26, 2010 are you saying VBA will eventually not be a platform in AutoCAD? Will it AutoCAD continue to run existing vba routines? do you have any documentation on this? Quote
Lee Mac Posted January 26, 2010 Posted January 26, 2010 Demise of VBA: http://www.cadtutor.net/forum/showthread.php?t=32857 Quote
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.