Cons and dotted pairs

Discussion in 'AutoCAD' started by Shaggyhou, Nov 29, 2004.

  1. Shaggyhou

    Shaggyhou Guest

    I am making a list to auto update information in bill of materials the problem I am having is in this bit of code hear,

    (setq rev_lst
    (list
    (cons "TEST" nnn)
    )
    )

    my variable nnn is actually the number of occurrences of another block in the drawing in my test drawing case it is 8. If I leave it out of quotes then I get an DXF code error but if I put it in quotes then I just the literal nnn. I have used this method before with text strings and it work but no that it is numeric it seems to be trying to make a dotted pair using the layer as a filter.
     
    Shaggyhou, Nov 29, 2004
    #1
  2. Shaggyhou

    C Witt Guest

    Command: (SETQ NNN 8)
    8
    Command: (cons "TEST" nnn)
    ("TEST" . 8)
    Command: (setq rev_lst
    (_> (list
    ((_> (cons "TEST" nnn)
    ((_> )
    (_> )
    (("TEST" . 8))

    works for me..
     
    C Witt, Nov 29, 2004
    #2
  3. Shaggyhou

    BillZ Guest

    Are you trying not to get the dot?

    Command: (setq nnn 8) ;variable as iteger
    8

    Command: (cons "TEST" nnn)
    ("TEST" . 8)

    Command: (setq nnn (list 8)) ;variable as list.
    (8)

    Command: (cons "TEST" nnn)
    ("TEST" 8)

    Bill
     
    BillZ, Nov 29, 2004
    #3
  4. Shaggyhou

    Shaggyhou Guest

    Thanks guys. I managed to get this way.

    (setq rev_lst
    (list
    (cons "QUANTITY" (itoa n))
    )
    )

    the problem with just setting 8 is I am placing concrete panels and for every one I insert it has to add one to the BOM it also has too be "backdateable" so that in current drawings I can just run the lisp and it mark the BOM correctly to what other inserts are there already. I did feel as though I needed my dunce cap though not even thinking of ITOA to give me a literal.
     
    Shaggyhou, Nov 29, 2004
    #4
  5. Shaggyhou

    Rob Guest

    .....the problem with just setting 8 is I am placing concrete panels
    and for every one I insert it has to add one to the BOM it also has
    too be "backdateable" so that in current drawings I can just run the
    lisp and it mark the BOM correctly to what other inserts are there
    already. I did feel as though I needed my dunce cap though not even
    thinking of ITOA to give me a literal....

    I know this is a bit off topic, however, I have just started with a
    Precast Concrete Panel manufacturer, and would be really interested in
    hearing more about your procedure. I'm not trying to plagurize, more
    get other peoples perspectives, and gain some insight on the process.
    I have for 20+ years been doing simple 2D engineering plans, but now
    need to use attributed blocks for schedules etc. I'd like to come up
    with some sort of BOM routine that worked over many drawings. The
    problem at first though isto define the process, before customizing
    it.... Thanks for any reply ;-))
     
    Rob, Nov 30, 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.