exploding plines routine

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

  1. vinayan

    vinayan 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
    ------------------------------------------------------------------
     
    vinayan, Sep 3, 2006
    #1
  2. vinayan

    Jeff Guest

    The Explode method does not remove the original object. Use MyPline.Delete
    after you explode it.
     
    Jeff, Sep 11, 2006
    #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.