Obtaining and Entity Handle

Discussion in 'AutoCAD' started by Sunburned Surveyor, Mar 2, 2005.

  1. How do I obtain an entity handle for a graphic object in AutoCAD using AutoLisp?

    For example: I want to retrieve the entity handle for a line selected by the user and store it in the variable "handle".

    Any ideas how this would be done?

    Thanks for the help.

    The Sunburned Surveyor
     
    Sunburned Surveyor, Mar 2, 2005
    #1
  2. Command: (setq ename (car (entsel)))
    Select object: <Entity name: 7ed66d90>
    Command: (cdr (assoc 5 (entget ename)))
    "17B9A"
     
    Luis Esquivel, Mar 2, 2005
    #2
  3. (setq HANDLE (cdr (assoc 5 (entget (car (entsel))))))
     
    Daniel J. Altamura, R.A., Mar 2, 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.