Local Attribute Visibility Toggle

Discussion in 'AutoCAD' started by Ryan Rayda, Feb 18, 2004.

  1. Ryan Rayda

    Ryan Rayda Guest

    Hey all.

    I posted this on the ACAD general board a while back and it seems that there
    is indeed no native functionality to accomplish my goal. Which is to
    control the display
    of attributes for individual occurences of a block.

    For example, say I have 10 water wells inserted in a drawing, I want them
    all to display the attribute value for "well_name" but only a few to display
    the value for "owner". I can modify the display of attributes globally
    (ATTDISP) or even globally for each block definition (BATTMAN), but not for
    each instance of a block.

    I do have the ability to do this via an add-on I have purchased (toolpac),
    but need
    this functionality for some of our clients for which it is not feasible to
    request they purchase this add-on. If you have any custom lisp routines or
    the likes, or if I am just overlooking this functionality native to AutoCAD,
    please let me know. Thanks for your help.


    Ryan
     
    Ryan Rayda, Feb 18, 2004
    #1
  2. Ryan Rayda

    Jon Guest

    This routine simply sets the flag 70 to value 1 (invisible)

    (defun c:attoff ()
    (setq attoff (nentsel "\nSelect Attribute to make Invisible : "))
    (if attoff
    (progn
    (setq attoff (car attoff)
    attoffent (entget attoff)
    )
    (if (= "ATTRIB" (cdr (assoc 0 attoffent)))
    (progn
    (setq attoffent (subst (cons 70 1) (assoc 70 attoffent) attoffent)
    nextent (entnext attoff)
    nextenttype (cdr (assoc 0 (entget nextent)))
    )
    (while (/= nextenttype "SEQEND")
    (setq nextent (entnext nextent)
    nextenttype (cdr (assoc 0 (entget nextent)))
    )
    )
    (setq blockheader (cdr (assoc -2 (entget nextent))))
    (entmod attoffent)
    (entupd blockheader)
    )
    (princ "\nNot an Attribute")
    )
    )
    )
    (princ)
    )


    Jon Rasmussen
     
    Jon, Feb 19, 2004
    #2
  3. Ryan Rayda

    Mike Weaver Guest

    Ryan,
    Here is another approach. This uses code 66 - visibility, as opposed to
    Jon's use of code 70 (which probably makes more sense). See poof.lsp posted
    in customer files.

    Derived from code originally posted on the Autodesk newsgroups by Paul
    Turvill (I think).

    Included functions:
    Name Purpose
    Poof Make selected objects invisible
    Unpoof Make visible objects hidden by poof
    PoofAtt Make selected attributes invisible
    UnPoofAtt Reverse the effects of PoofAtt


    Mike Weaver
     
    Mike Weaver, Feb 19, 2004
    #3
  4. Ryan Rayda

    Mike Weaver Guest

    I don't use the one I posted either. Some of it I wrote a while back out of
    curiosity because of Paul Turvill's post. The attribute functions I wrote
    because I thought it would be simple to piggyback it onto the previous code.

    I had forgotten about the 60 flag, which I would have considered more
    sensible since it is there specifically to make attributes invisible.

    Mike
     
    Mike Weaver, Feb 19, 2004
    #4
  5. Ryan Rayda

    Ryan Rayda Guest

    Hey Jon.

    Thanks so much for your kind response to my post. I really appreciate you
    taking time out of your day to help a customization newbie out.

    Ryan
     
    Ryan Rayda, Feb 19, 2004
    #5
  6. Ryan Rayda

    Ryan Rayda Guest

    Hey Mike.

    Thanks so much for your kind response to my post. I really appreciate you
    taking time out of your day to help a customization newbie out.

    Ryan
     
    Ryan Rayda, Feb 19, 2004
    #6
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.