Verify Attribute

Discussion in 'AutoCAD' started by ghiggins457, Mar 3, 2004.

  1. ghiggins457

    ghiggins457 Guest

    I am working with a number of blocks that have attributes. When these blocks are entered into the drawing, the user is prompted to ask a series of questions so that certain text will be entered into the drawing. The only problem is that when these attributes were created, the "Verify Mode" button was checked and now the user has to go through these questions twice. Is there any way to turn this off with out setting up another attribute and redoing it all?

    Thanks for any help.

    Greg
     
    ghiggins457, Mar 3, 2004
    #1
  2. ghiggins457

    Jeff Mishler Guest

    Use this lisp to change the "Verify" property of all attribute
    definitions in a block def. from true to false.
    Example, to change the attributes in the block named "test", type this
    at the command line:

    (unverifyatt "test")


    (defun unverifyAtt (bname / blk)
    (vl-load-com)
    (setq blk (vla-item (vla-get-blocks
    (vla-get-activedocument
    (vlax-get-acad-object)))
    bname))
    (vlax-for ent blk
    (if (= (vla-get-objectname ent) "AcDbAttributeDefinition")
    (vla-put-Verify ent :vlax-false)
    )
    )
    (princ)
    )

    HTH,
    Jeff

    blocks are entered into the drawing, the user is prompted to ask a
    series of questions so that certain text will be entered into the
    drawing. The only problem is that when these attributes were created,
    the "Verify Mode" button was checked and now the user has to go through
    these questions twice. Is there any way to turn this off with out
    setting up another attribute and redoing it all?
     
    Jeff Mishler, Mar 3, 2004
    #2
  3. ghiggins457

    ghiggins457 Guest

    Thanks for the lisp routine. However, when I load it and try to run it. It says that there are too few arguments. Any other suggestions?
    Thanks again.
    Greg
     
    ghiggins457, Mar 3, 2004
    #3
  4. ghiggins457

    ECCAD Guest

    Greg,
    I am quite sure that Jeff's routine will work, they always do.
    You need to 'feed' in a blockname for the function. Example:
    (unverifyAtt blockname), where you set the blockname as:
    (setq blockname "myblock"); set a blockname into variable
    (unverifyAtt blockname); call the function, feed in a block

    Or:
    (unverifyAtt "myblock"); would do it directly..

    Bob
     
    ECCAD, Mar 3, 2004
    #4
  5. ghiggins457

    ECCAD Guest

    Greg,
    Also, after 'unverifying' the attributes of the particular block,
    you will need to 'wblock' it back to its original .dwg - IF you want it to stay that way.

    Bob
     
    ECCAD, Mar 3, 2004
    #5
  6. ghiggins457

    Jeff Mishler Guest

    Not sure......however, here is a different version that will ask for a
    block name and make sure it is valid prior to running. Make sure to copy
    all of the )'s.....to run just type "unverify" at the command prompt.

    Jeff

    (defun c:unverify (/ bname blk)
    (vl-load-com)
    (initdia 1)
    (setq bname (getstring "\nBlock name to reset 'verify' property?: "))
    (if (tblsearch "block" bname)
    (progn
    (setq blk (vla-item (vla-get-blocks
    (vla-get-activedocument
    (vlax-get-acad-object)))
    bname))
    (vlax-for ent blk
    (if (= (vla-get-objectname ent) "AcDbAttributeDefinition")
    (vla-put-Verify ent :vlax-false)
    )
    )
    )
    (princ "\nInvalid block name, try again.....")
    )
    (princ)
    )



    it. It says that there are too few arguments. Any other suggestions?
     
    Jeff Mishler, Mar 3, 2004
    #6
  7. ghiggins457

    ghiggins457 Guest

    I do not doubt that it will work for a person that knows what they are doing. I, on the other hand, must be the one that doesn't know. I am getting a message that reads:

    error: no function definition: UNVERIFYATT

    I get this message when I try running the lisp routine. This is what I am writing in the command prompt:

    (unverifyAtt "90 ELL")

    Tell me if I am doing something wrong.

    Thanks again.

    Greg
     
    ghiggins457, Mar 3, 2004
    #7
  8. ghiggins457

    ghiggins457 Guest

    Still getting the same thing. I don't know what I'm doing wrong. I will keep trying to work on it. Thanks.
     
    ghiggins457, Mar 3, 2004
    #8
  9. ghiggins457

    Jeff Mishler Guest

    What version of ACAD are you using? If you use Bpb's directions (thanx,
    Bob!) he made a minor error......the second lisp I posted is run by
    typing "unverify" NOT "unverifyatt".....

    Jeff

    will keep trying to work on it. Thanks.
     
    Jeff Mishler, Mar 3, 2004
    #9
  10. ghiggins457

    ECCAD Guest

    Jeff,
    Oh, I didn't see you shortened the fn name. :))
    Bob
     
    ECCAD, Mar 3, 2004
    #10
  11. ghiggins457

    ECCAD Guest

    Jeff,
    He's getting an error with (vla-item..
    any clues ?
    Bob
     
    ECCAD, Mar 3, 2004
    #11
  12. ghiggins457

    ECCAD Guest

    Jeff,
    I just tried the 2nd example, all is OK. No problems. I made a block, and changed it. I'm running with R2002.
    He might be running in R2000 ?

    Bob
     
    ECCAD, Mar 3, 2004
    #12
  13. ghiggins457

    ghiggins457 Guest

    Actually, I am running AutoCAD 2004 Lite with the Sling Shot Max add on Lisp routine program. I don't know if you are familiar with that program, but it enables AutoCAD to run lisp routines. I have created a bunch and have been able to run them all, except for Jeff's.
    Thanks for the help, and I'm getting all the stuff zipped up and sent to you Bob.

    Greg
     
    ghiggins457, Mar 4, 2004
    #13
  14. Jeff,

    It appears that Greg's blocks have a spaces in them.

    Perhaps this will help:

    (setq bname (getstring T "\nBlock name to reset 'verify' property?:
    "))


    --
    Ken Alexander
    Acad2004
    Windows2000 Prof.

    "We can't solve problems by using the same kind
    of thinking we used when we created them."
    --Albert Einstein
     
    Ken Alexander, Mar 4, 2004
    #14
  15. ghiggins457

    ECCAD Guest

    All,
    I got an E-Mail, explaining problem. He is using R2004 LT.
    Dumb question: Does 2004 LT support loading / running Lisp ??

    Bob
     
    ECCAD, Mar 4, 2004
    #15
  16. ghiggins457

    ghiggins457 Guest

    We are using an add on program that is made for LT to run lisp routines. It is called Slingshot Max. I have written and ran several lisp routines using this program over the past 2 weeks. LT by itself does not run lisp routines, but with this add on program, it runs it.
     
    ghiggins457, Mar 4, 2004
    #16
  17. ghiggins457

    ECCAD Guest

    Greg,
    Ok, I didn't realize you had the add-on.
    Shall we continue via E-Mail ?

    Bob
     
    ECCAD, Mar 4, 2004
    #17
  18. ghiggins457

    Jeff Mishler Guest

    Bob, Greg -
    I've revised the lisp to use standard lisp functions. I think that LT
    with the add-on has a problem with the ActiveX methods & properties.

    Try this & let me know.....

    Jeff

    (defun c:unverify (/ bname ent);revised to use standard lisp vs AvtiveX
    (initdia 1)
    (setq bname (getstring t "\nBlock name to reset 'verify' property?:
    "))
    (if (tblsearch "block" bname)
    (progn
    (setq ent (entget (tblobjname "block" bname)))
    (while (setq ent (entget (entnext (cdr (car ent)))))
    (if (and
    (= (cdr (assoc 0 ent)) "ATTDEF")
    (= (logand (cdr (assoc 70 ent)) 4) 4)
    )
    (progn
    (setq ent (subst (cons 70 (- (cdr (assoc 70 ent)) 4))
    (assoc 70 ent) ent))
    (entmod ent)
    )
    )
    )
    )
    (princ "\nInvalid block name, try again.....")
    )
    (princ)
    )
     
    Jeff Mishler, Mar 4, 2004
    #18
  19. ghiggins457

    ghiggins457 Guest

    Bob,
    Yes. We can continue via email. I sure would like to get this thing going.
     
    ghiggins457, Mar 4, 2004
    #19
  20. ghiggins457

    ECCAD Guest

    Greg,
    Did you try Jeff's posting 19:21, new 'regular' lisp ?
    Bob
     
    ECCAD, Mar 4, 2004
    #20
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.