Block attributes by formula?

Discussion in 'AutoCAD' started by DAVEF, Mar 15, 2005.

  1. DAVEF

    DAVEF Guest

    I am running AutoCAD 2002. I would like to make a block with 3 attributes associated with it. I want to be able to enter the a value for the first attribute, then have the values for the next attributes calculated using a simple formula. Ex. I want to be able to enter 25 as the value of my first attribute. For the value of my second attribute I want to display (25 -8) and have 17 displayed as the value of my second attribute.
    I am a real novice at Lisp so any advice in how to achieve this is greatly appreciated.
     
    DAVEF, Mar 15, 2005
    #1
  2. DAVEF

    Jeff Mishler Guest

    Overly simplified, but this should get you started:

    (setq bname "block name to insert")
    (setq inspt (getpoint "\nSelect insertion point: "))
    (setq att1 (getint "\nBase number: "))
    (setq att2 (- att1 8)); or whatever
    (setq att3 (+ att1 4)); or whatever
    (command "-insert" bname inspt "" "" "" (itoa att1) (itoa att2) (itoa att3))
     
    Jeff Mishler, Mar 15, 2005
    #2
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.