Different get input

Discussion in 'AutoCAD' started by Adesu, Sep 30, 2004.

  1. Adesu

    Adesu Guest

    $ (setq ss (ssget '((0 . "CIRCLE"))))
    <Selection set: 10>

    _$ (setq ent (car (entsel "\nSELECT A CIRCLE: ")))
    <Entity name: 14b85c8>

    _$ (setq ent (entget (car (entsel "\nSELECT A CIRCLE: "))))
    ((-1 . <Entity name: 14b85c8>) (0 . "CIRCLE") (330 . <Entity name: 14b84f8>)
    (5 . "51") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbCircle") (10 5.3227 11.5047 0.0) (40 . 1.66312) (210 0.0 0.0 1.0))

    Hi Alls,sometimes in program lisp , like this " (setq ss (ssget '((0 .
    "CIRCLE")))) " and " (setq ent (car (entsel "\nSELECT A CIRCLE: "))) ",but I
    prefer like to " (setq ent (entget (car (entsel "\nSELECT A CIRCLE: "))))
    ".
    What is different function for first and second option ?
     
    Adesu, Sep 30, 2004
    #1
  2. Adesu

    Joe Burke Guest

    Adesu,

    All the methods you mentioned are valid depending on what you intend to do later with
    the data returned.

    Examples:

    (setq ent (entsel "/nSelect object: "))
    You want to access the ename of the object (car ent) and the point picked (cadr ent).

    (setq ent (car (entsel "/nSelect object: ")))
    You are only interested in the ename of the object.

    (setq elst (entget (car (entsel "/nSelect object: "))))
    The ename of the object is of no interest, but it's data list is.

    HTH
    Joe Burke
     
    Joe Burke, Sep 30, 2004
    #2
  3. Adesu

    Doug Broad Guest

    And a selection set allows you to work with more than one object.
     
    Doug Broad, Sep 30, 2004
    #3
  4. Adesu

    Adesu Guest

    Hi Doug and Jou,I accept your argument,and now I more understand,thanks a
    lot
     
    Adesu, Oct 1, 2004
    #4
  5. Adesu

    Joe Burke Guest

    Adesu,

    You're welcome.

    Joe Burke
     
    Joe Burke, Oct 1, 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.