get the block @ a point with a given name

Discussion in 'AutoCAD' started by hutch, Apr 2, 2005.

  1. hutch

    hutch Guest

    This works:
    (ssget "x" '((0 . "INSERT")(2 . "MyBlock")))

    But this does not:
    (ssget "x" '((0 . "INSERT")(2 . "MyBlock")(cons 10 pnt)))

    Why? Can't I include the point in the filter?
    pnt is a list like this --> (x y z)
     
    hutch, Apr 2, 2005
    #1
  2. hutch

    Jeff Mishler Guest

    You can't use cons in a quoted list. Try this:
    (ssget "x" (list '(0 . "INSERT") '(2 . "MyBlock") (cons 10 pnt)))
     
    Jeff Mishler, Apr 2, 2005
    #2
  3. hutch

    Jürg Menzi Guest

    Hi Hutch

    In general see Jeff's answer. Because of inaccuracy of decimal numbers I would
    suggest use a fuzzy point filter method:
    Code:
    (setq PreVal 1E-8
    LolPnt (mapcar '- Pnt (list PreVal PreVal PreVal))
    UprPnt (mapcar '+ Pnt (list PreVal PreVal PreVal))
    )
    (ssget "X" (list
    '(0 . "INSERT")
    '(2 . "MyBlock")
    '(-4 . ">,>,>") (cons 10 LolPnt)
    '(-4 . "<,<,<") (cons 10 UprPnt)
    )
    )
    
    Cheers
     
    Jürg Menzi, Apr 3, 2005
    #3
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.