entsel

Discussion in 'AutoCAD' started by mnash, Jul 22, 2004.

  1. mnash

    mnash Guest

    (setq pt1 '(0.0 0.0 0.0))
    how do I select an entity based on pt1 and be able to use that for an entget assoc car 10 for the object
     
    mnash, Jul 22, 2004
    #1
  2. Or, if you don't need the "ent" saved to use for any other purpose, you can
    combine them into:
    (setq entdata (entget (car (nentselp pt1))))

    And if you don't need to get any data about it other than its assoc 10
    value, you can forget saving the "entdata" variable too, and just directly
    get the one piece of information you need:
    (setq whatyouwanttocallit (cdr (assoc 10 (entget (car (nentselp pt1))))))

    And if you don't even need to save THAT for any other later purpose, but
    just want to use it once, you can forget the setq part altogether, for
    example:
    (command "line" (cdr (assoc 10 (entget (car (nentselp pt1)))))
    <to-wherever-else> "")

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Jul 22, 2004
    #2
  3. In fact, if you don't need pt1 saved for any other purpose either, I guess
    you could forget saving that and go directly with (in the same Line
    example):
    (command "line" (cdr (assoc 10 (entget (car (nentselp '(0.0 0.0 0.0))))))
    <to-wherever-else> "")

    Kent Cooper, AIA


    ...
     
    Kent Cooper, AIA, Jul 22, 2004
    #3
  4. mnash

    john m Guest

    if i select an entity based on a point i usually get something i didn't
    expect like an xref or something else close by

    entget assoc car 10 for the object
     
    john m, Jul 22, 2004
    #4
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.