Convert selection set to dxf

Discussion in 'AutoCAD' started by Adesu, Nov 9, 2004.

  1. Adesu

    Adesu Guest

    _$ (setq ss (ssget))
    <Selection set: 2d>

    _$ (setq ssdata (entget ss))
    ; error: bad argument type: lentityp <Selection set: 2d>

    _$ (setq ssdata (entget (car ss)))
    ; error: bad argument type: consp <Selection set: 2d>

    _$ (setq ssdata (entsel ss))
    ; error: bad argument type: stringp <Selection set: 2d>
    _$

    I mean and I want

    from

    <Selection set: 2d>

    to

    ((-1 . <Entity name: 14c6840>) (0 . "CIRCLE") (330 . <Entity name: 14c64f8>)
    (5 . "98") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbCircle") (10 0.0 0.0 0.0) (40 . 25.0) (210 0.0 0.0 1.0))
    "98"
     
    Adesu, Nov 9, 2004
    #1
  2. Adesu

    LUCAS Guest

    (setq ssdata (entget (ssname (ssget ":s") 0)))
    (print ssdata)
    (setq ssdata (entget (car (entsel))))
    (print ssdata)
     
    LUCAS, Nov 9, 2004
    #2
  3. Adesu

    Alaspher Guest

    Hi, Adesu!

    You can get DXF for entity through (entget (ssname ss i)), where "i" - indicating an element in a selection set.

    Regards
     
    Alaspher, Nov 9, 2004
    #3
  4. Adesu

    Adesu Guest

    Hi Alaspher & LUCAS,thanks a lot.

    indicating an element in a selection set.
     
    Adesu, Nov 9, 2004
    #4
  5. Adesu

    Adesu Guest

    Hi Alaspher,like this

    _$ (setq ss (ssget))
    <Selection set: 4a>
    _$ (setq i (- (sslength ss) 1))
    0
    _$ (setq ss1 (entget (ssname ss i)))
    ((-1 . <Entity name: 14c68b0>) (0 . "CIRCLE") (330 . <Entity name: 14c64f8>)
    (5 . "A6") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 . "0") (100 .
    "AcDbCircle") (10 20.6366 0.270845 0.0) (40 . 6.27394) (210 0.0 0.0 1.0))
    _$

    indicating an element in a selection set.
     
    Adesu, Nov 9, 2004
    #5
  6. Adesu

    Alaspher Guest

    Yes, if you want to get last object in selection set. Because selection set contain only one object in your example, this object has index '0'.
     
    Alaspher, Nov 9, 2004
    #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.