Auto Field

Discussion in 'AutoCAD' started by A-DESIGN, Aug 24, 2004.

  1. A-DESIGN

    A-DESIGN Guest

    Is it possible to make a filed that can get changed when is getting copyied?
    For example the field is showing "A-1",when you make a copy of it the copy
    is going to be

    "A-2" and so on. Thanks
     
    A-DESIGN, Aug 24, 2004
    #1
  2. Haven't tried it but it should be possible. You'll need to:

    1. Add code to a document event such as EndCommand
    2. Test the command name to see if the command was COPY
    3. Then check to see if the copied item was a field object
    4. Assuming 3 is true, then grab the value [or text] of the field
    5. Increment the value as necessary
    6. Put the value back into the field.

    This is just a game plan but it should be close to what you need to do.

    -- Mike
    ___________________________
    Mike Tuersley
    CADalyst's CAD Clinic
    Rand IMAGINiT Technologies
    ___________________________
    the trick is to realize that there is no spoon...
     
    Mike Tuersley, Aug 24, 2004
    #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.