Find Circles and arcs in a drawing

Discussion in 'AutoCAD' started by Garry, Jun 28, 2004.

  1. Garry

    Garry Guest

    Is it possible to find all the circles and arcs within a
    drawing and then do something to the circles and arcs.
    Is it possible to get the radius, centre point of the circles
    and arcs even if they are on a locked or frozen layer.
    What do i do to find the circles and arcs.
    I am new to VBA so any help would probably be
    good help.
    Thanks
    Garry
     
    Garry, Jun 28, 2004
    #1
  2. Look at this code. maybe can help you


    Public Sub FindCirclesAndArcs()

    ' Create the selection set
    Dim ssetObj As AcadSelectionSet
    Set ssetObj = ThisDrawing.SelectionSets.Add("SSET")

    Dim mode As Integer
    mode = acSelectionSetAll
    Dim gpCode(0) As Integer
    Dim dataValue(0) As Variant
    gpCode(0) = 0
    dataValue(0) = "Circle"

    ssetObj.Select mode, , , groupCode, dataCode

    Dim Acircle As AcadCircle
    Dim radior As Double
    Dim LayerState As String
    Dim CircleLayer As String


    For i = 0 To ssetObj.Count - 1
    Set Acircle = ssetObj.Item(i)
    CircleLayer = Acircle.Layer
    If ThisDrawing.Layers.Item(CircleLayer).LayerOn Then LayerState =
    "ON" Else LayerState = "OFF"
    Response = MsgBox("El radio del circulo " & CStr(i + 1) & " es = " &
    CStr(Acircle.Radius) & " y su capa esta " & LayerState, vbInformation,
    "Datos")
    Next i

    End Sub


    With the arcs is the same.

    Sergio
    Colombia
     
    Sergio Cornejo, Jun 28, 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.