Return the selected vertex of a polyline

Discussion in 'AutoCAD' started by mgrigoriev, Jan 7, 2004.

  1. mgrigoriev

    mgrigoriev Guest

    GetSubEntity and GetEntity methods return the whole polyline (if a polyline is picked, of course). Is there a way to return only one vertex, the one that is actually clicked on?
     
    mgrigoriev, Jan 7, 2004
    #1
  2. Hi,

    Why not, set your snapmode to end and then use a getpoint command ?

    --


    Laurie Comerford
    CADApps
    www.cadapps.com.au

    polyline is picked, of course). Is there a way to return only one vertex,
    the one that is actually clicked on?
     
    Laurie Comerford, Jan 7, 2004
    #2
  3. mgrigoriev

    mgrigoriev Guest

    Thanks, Laurie. I am sure this would work for most cases, but in my case I can't use any snap at all. I need to be able to pick any kinds of entities, including text , text attributes, and so on. Snap will just make it more complicated. I can use only GetSubEntity or GetEntity methods.
    Is there any other way to return one vertex from a polyline?
     
    mgrigoriev, Jan 7, 2004
    #3
  4. Another way would be to compare all vertices to the pick point to select the
    closest one.
    --
    Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

    can't use any snap at all. I need to be able to pick any kinds of entities,
    including text , text attributes, and so on. Snap will just make it more
    complicated. I can use only GetSubEntity or GetEntity methods.
     
    Jorge Jimenez, Jan 8, 2004
    #4
  5. Jorge's right. In fact, in your specific case you might do the following:

    1) Pick the POINT (not an entity) and save it in variable
    2) make a SELECTION set of everything that falls within small range around
    it (say, 0.0001)
    3) loop through the selection set until you find the POLYLINE
    4) loop through all polyline VERTICES until you find the picked one, or...
    5) try to find the nearest vertice to the picked point

    Regards,
    Maksim Sestic
     
    Maksim Sestic, Jan 8, 2004
    #5
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.