Arc Help!

Discussion in 'AutoCAD' started by Jason Smith, Feb 7, 2004.

  1. Jason Smith

    Jason Smith Guest

    I have been pulling my hair out trying to come up with a method of drawing
    an arc with vba with only the arc startpoint, endpoint and starting
    direction without using the "SendCommand" function. My routine creates a
    series of arcs based on user selected points and adds them to a selection
    set. It then uses the arc as construction lines to create a flexible duct
    section. The problems is, due to the "SendCommand" you cannot just hit
    enter to reissue the command. It runs the arc command instead. REAL PAIN!

    Startpoint and endpoint are user selected points and the angle is obtained
    from the previous segment. I have a Do Loop that repeats. My code is as
    follows:

    Do..... While...
    ..
    ..
    ..

    sp = CStr(StartPoint(0)) & "," & CStr(StartPoint(1))
    ep = CStr(EndPoint(0)) & "," & CStr(EndPoint(1))
    Pi = 4 * Atn(1)
    ArcDir = CStr(Direction * 180 / Pi)
    ThisDrawing.SendCommand ("arc" & vbCr & sp & vbCr & "e" & vbCr & ep & vbCr &
    "d" & vbCr & ArcDir & vbCr)
    Set FlexArcs = ThisDrawing.SelectionSets.Add("FlexArcs")
    If Err.Number = -2145320851 Then
    Err.Clear
    ThisDrawing.SelectionSets.Item("FlexArcs").Delete
    Set FlexArcs = ThisDrawing.SelectionSets.Add("FlexArcs")
    End If
    FlexArcs.Select acSelectionSetLast
    StartPoint = EndPoint
    EndPoint = ThisDrawing.Utility.GetPoint(StartPoint, "Select next point:
    <enter to end>")

    ..
    ..
    ..
    Loop

    Any help is greatly appreciated. Thanks in advance.

    Jason Smith
     
    Jason Smith, Feb 7, 2004
    #1
  2. Search vbdesign.net - Randall has source to do this already.
    ___________________________
    Mike Tuersley
    CADalyst's AutoCAD Clinic
    Rand IMAGINiT Technologies
     
    Mike Tuersley, Feb 8, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.