Transforms a VLA-object to an AutoLISP entity

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

  1. Adesu

    Adesu Guest

    I've got a line

    $ (setq ent (vlax-ename->vla-object (car (entsel "\nSELECT A LINE: "))))
    #<VLA-OBJECT IAcadLine 01aac954>

    _$ (setq ent1 (vlax-vla-object->ename ent))
    <Entity name: 14b7a70>

    $ (setq ent2 (entget (car (entsel ent))))
    ; error: bad argument type: stringp ((-1 . <Entity name: 14b7a70>) (0 .
    "LINE") (330 . <Entity name: 14b78f8>) (5 . "66") (100 . "AcDbEntity") (67 .
    0) (410 . "Model") (8 . "0") (370 . 200) (100 . "AcDbLine") (10 3.66863
    10.4877 0.0) (11 17.7918 10.4877 0.0) (210 0.0 0.0 1.0))
    _$

    Why display " ; error: bad argument type: stringp ",can you help me to
    inform it,thanks
     
    Adesu, Sep 24, 2004
    #1
  2. Adesu -

    Because entsel expects a string (typically a user prompt) as an argument. You can pass your ent1 directly to the entget function.

    Peter
     
    petersciganek, Sep 24, 2004
    #2
  3. Adesu

    Adesu Guest

    Hi petersciganek,yes you are right,thanks a lot

    _$ (vl-load-com)
    _$ (setq ent (vlax-ename->vla-object (car (entsel "\nSELECT A LINE: "))))
    #<VLA-OBJECT IAcadLine 01aa52d4>

    _$ (setq ent1 (vlax-vla-object->ename ent))
    <Entity name: 14b7580>

    _$ (setq ent2 (entget ent1))
    ((-1 . <Entity name: 14b7580>) (0 . "LINE") (330 . <Entity name: 14b74f8>)
    (5 . "48") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbLine") (10 3.55481 11.0674 0.0) (11 16.7708 11.0674 0.0) (210 0.0 0.0
    1.0))
    _$



    You can pass your ent1 directly to the entget function.
     
    Adesu, Sep 24, 2004
    #3
  4. Adesu

    Jim Claypool Guest

    Why not just use
    (setq ent2 (entget (car (entsel "\nSELECT A LINE: "))))
     
    Jim Claypool, Sep 24, 2004
    #4
  5. Adesu

    Adesu Guest

    Hi Jim,I am learning how "vlax-vla" work,thanks

     
    Adesu, Sep 27, 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.