error: bad DXF group: ((1 2.61126))

Discussion in 'AutoCAD' started by Jaybo, Sep 16, 2003.

  1. Jaybo

    Jaybo Guest

    I am writing a litle routine to update our room tags w/ the area of the room.

    I'm using entmod to update the assoc of the room tag attribute. But it seems that the a2 value needs to be in quotes...?

    Does not work:
    (setq new (subst (list (cons 1 a2)) val partlst))

    If I change a2 variable to the actual area value (at the time) "2.61126" everything is peachy.

    Works:
    (setq new (subst (list (cons 1 "2.61126" a2)) val partlst))

    ...also if you find that my code isn't clean or theres an easier way of doing things, I'm open to suggestion as it's been a while since I've written a routine...
    Thanks in advance.
     
    Jaybo, Sep 16, 2003
    #1
  2. Hi,

    just removing the (list) from your (cons) should do it...

    (setq new (subst (cons 1 a2) val partlst))

    hth
     
    ruul morawetz, Sep 16, 2003
    #2
  3. Jaybo

    Jaybo Guest

    Thanks Ruul - But the "list" was just part of the troubleshooting (has no effect either way). I forgot to take it out before I posted...
     
    Jaybo, Sep 16, 2003
    #3
  4. hmpf...
    :-/
    ok

    0) use local variables
    1) why (command "list") ?
    2) the area is obviously calculated before entering the routine-as you like
    3) filter your inserts (ssget '((0 . "INSERT")(66 . 1)))


    and

    4) http://tinyurl.com/nlli
    5) http://tinyurl.com/nlll

    hth
     
    ruul morawetz, Sep 16, 2003
    #4
  5. (setq a2 (getvar "area")) returns a real value, attributes are
    strings. (setq a2 (rtos (getvar "area"))) is a start.

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein

    it seems that the a2 value needs to be in quotes...?
    "2.61126" everything is peachy.
    of doing things, I'm open to suggestion as it's been a while since
    I've written a routine...
     
    Ken Alexander, Sep 16, 2003
    #5
  6. eagle-eyes ;-)

    me OTOH: zzzzzzzzzzzzzzZZZZ
     
    ruul morawetz, Sep 16, 2003
    #6
  7. Just the other day I heard:
    "It takes a simple one to simplify a simple thing." <g>

    --
    Ken Alexander
    Acad2000
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Sep 16, 2003
    #7
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.