select object + the selection point

Discussion in 'AutoCAD' started by juno, Apr 8, 2005.

  1. juno

    juno Guest

    I would like to be able to select a Line or PLine and get the entity information (startpoint…) and also get the selection point ID.

    I have done it a long time ago but I don’t remember what I did.

    Any help would be appreciated,

    Thank you,

    -J
     
    juno, Apr 8, 2005
    #1
  2. juno

    antmjr Guest

    be aware that the point that .GetEntity returns does not necessarily belong to the picked object; unfortunately .GetEntity doesn’t support an osnap mode, like, say, EndPoint or Nearest, so it returns the actual point you have picked, which quite never belongs to your object

    If you want to select an object by picking a point that belongs to the object for sure, you have to pick a point first…

    ThisDrawing.SetVariable "osmode", 513 'end + nearest
    p0 = ThisDrawing.Utility.GetPoint

    …and then to select the object via .SelectAtPoint, maybe with a filter and some error trappings

    intCodes(0) = 0: varCodeValues(0) = "LINE"
    ss1.SelectAtPoint ThisDrawing.Utility.TranslateCoordinates(p0, acWorld, acUCS, False) _
    , intCodes, varCodeValues

    maybe there are other ways, but I don’t know them (I still use acad2002)
     
    antmjr, Apr 8, 2005
    #2
  3. juno

    juno Guest

    Thank you for the help.

    I guess my options are: GetEntity or GetPoint.

    I like the GetPoint method, do you have any preference on one over the other method.

    -J
     
    juno, Apr 8, 2005
    #3
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.