Jump to content

Recommended Posts

Posted

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.

Posted

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)
)

Posted

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

Posted

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?

Posted

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.

Posted

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?

Posted

Demise of VBA:

http://www.cadtutor.net/forum/showthread.php?t=32857

vbaide.png

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...