Help me with exploding polylines

Discussion in 'AutoCAD' started by vinayanchess, Sep 3, 2006.

  1. vinayanchess

    vinayanchess Guest

    Hi friends,
    This is my first attempt to write a vba code.
    My aim was to select all polylines among all selection
    and explode them.That worked fine!.But all the lines i
    obtained were duplicates.Can anyone help me with this
    problem? I would be very thankful.
    Here goes the code..............
    -----------------------------------------------------------------
    Sub exp()
    Dim Mypline As AcadLWPolyline
    Dim fType(0) As Integer, fData(0)
    Set adSS = ThisDrawing.SelectionSets.Add("adSS")
    If Err Then Set adSS = ThisDrawing.SelectionSets.Add("adSS")
    adSS.Clear
    fType(0) = 0: fData(0) = "LWPOLYLINE"
    adSS.Select acSelectionSetAll, , , fType, fData
    For Each Mypline In adSS
    Mypline.Explode
    Next Mypline
    ThisDrawing.Application.Update
    adSS.Clear

    End Sub
    ------------------------------------------------------------------
     
    vinayanchess, Sep 3, 2006
    #1
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.