Doubt of (entlast) return value

Discussion in 'AutoCAD' started by James Chung, Mar 29, 2005.

  1. James Chung

    James Chung Guest

    ACAD2000

    'AutoLISP Reference' said,
    "The entlast function is frequently used to obtain the name of a new entity that has just been added with the command function. To
    be selected, the entity need not be on the screen or on a thawed layer."

    But I get a strange return value of (entlast) with following.

    (command "._line" "_none"(list 0.0 0.0) "_none"(list 0.0 5.0) "")
    (entmake '((0 . "CIRCLE") (62 . 1) (10 4.0 4.0 0.0) (40 . 1.0)))
    (print(cdr(assoc 0(entget(entlast)))))

    The last return was "CIRCLE".

    Is this right return value?
    Do you get same return value?
    If not, what's wrong with me?
    Is entmake a kind of command function?

    Thanks
    James Chung
    "Nothing impossible, just requires time, but efficiency saves time."
     
    James Chung, Mar 29, 2005
    #1
  2. James Chung

    ECCAD Guest

    Yes,
    Entmake is a function that actually 'adds' an Entity to the
    AutoCAD drawing database. Therefore, your 'line' is
    'next' to Last, and the Circle is actually the Last.

    Bob
     
    ECCAD, Mar 29, 2005
    #2
  3. James Chung

    James Chung Guest

    Thanks BollZ.

    How do you think about my last question?
    "Is entmake a kind of command function?"
     
    James Chung, Mar 29, 2005
    #3
  4. James Chung

    James Chung Guest

    Thanks, Bob
     
    James Chung, Mar 29, 2005
    #4
  5. James Chung

    BillZ Guest

    Is entmake a kind of command function?<<<

    To understand this, I think you have to look at the line in the help files again:

    The entlast function is frequently used to obtain the name of a new entity that has just been added with the command function..<<<

    It does not say that is is the only way that you can add an entity.

    Entmake is an autolisp function that creates entities by feeding it an association list.
    Command, on the other hand, calls functions like array, copy, line, circle ect. that take the inherent properties from other entities or the drawing settings.

    Also, previous to that statement in the help files it says:

    "Returns the name of the last nondeleted main object (entity) in the drawing"

    Doesn't say how it got there. :)

    HTH

    Bill
     
    BillZ, Mar 29, 2005
    #5
  6. James Chung

    James Chung Guest

    "It does not say that is the only way that you can add an entity."
    awaked me.
    Thanks again, Bill.
     
    James Chung, Mar 30, 2005
    #6
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.