+ Reply to Thread
Results 1 to 7 of 7
  1. #1
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default Who has got the "ddatte dialog with invisible toggles" ?

    Registered forum members do not see this ad.

    A long time ago I used a lisp file that worked almost the same as the "ddatte" function / dialog. I believe it was part of an application, that I no longer work with since several years.

    One big difference to the ommon "ddatte dialog" was that it had toggle switches (checkboxes) to set the attribute to visible / invisible.

    Does anyone around still have that / such routine? I'd be glad to get a copy.

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,726

    Default

    This will make your Atts invisible:

    Code:
    (defun c:invis (/ ent obj)
      (vl-load-com)
    
      (while (setq ent (car (nentsel "\nSelect Attribute: ")))
        (if (eq "ATTRIB" (cdr (assoc 0 (entget ent))))
          (vlax-put (setq obj (vlax-ename->vla-object ent)) 'invisible -1)))
    
      (princ))
    Or, as a different functionality, this will make all tags with the listed name visible/invisible:

    Upon Selection
    Code:
    (defun c:am1 (/ tag ss att obj)
      (vl-load-com)
    
      (setq tag "TAG1")
    
      (while (setq ss (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1))))
        (foreach att (append (vlax-invoke (setq obj (vlax-ename->vla-object (ssname ss 0))) 'GetAttributes)
                             (vlax-invoke obj 'GetConstantAttributes))
          (if (eq tag (strcase (vla-get-TagString att)))
            (vlax-put att 'Invisible (~ (vlax-get att 'Invisible))))))
    
      (princ))
    All Blocks:
    Code:
     
    (defun c:am2 (/ tag ss sel)
      (vl-load-com)
    
      (setq tag "TAG1") ;; <<-- Tag to be Searched
    
      (and (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1))))
           (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet
                                     (vla-get-ActiveDocument (vlax-get-acad-object))))
              (foreach att (append (vlax-invoke Obj 'GetAttributes)
                                   (vlax-invoke Obj 'GetConstantAttributes))
                (if (eq tag (strcase (vla-get-TagString att)))
                  (vlax-put att 'Invisible (~ (vlax-get att 'Invisible))))))
           (vla-delete sel))
    
      (princ))
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Luminous Being alanjt's Avatar
    Using
    Civil 3D 2011
    Join Date
    Apr 2008
    Posts
    6,004
    DropBox | finding the light...
    Seann: ...it went crazy ex-girlfriend on me...
    eric_monceaux...its pretty funny seeing two AutoCAD Gods give each other flak...

  4. #4
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Quote Originally Posted by Lee Mac View Post
    This will make your Atts invisible:

    Code:
    (defun c:invis (/ ent obj)
      (vl-load-com)
     
      (while (setq ent (car (nentsel "\nSelect Attribute: ")))
        (if (eq "ATTRIB" (cdr (assoc 0 (entget ent))))
          (vlax-put (setq obj (vlax-ename->vla-object ent)) 'invisible -1)))
     
      (princ))
    Or, as a different functionality, this will make all tags with the listed name visible/invisible:

    Upon Selection
    Code:
    (defun c:am1 (/ tag ss att obj)
      (vl-load-com)
     
      (setq tag "TAG1")
     
      (while (setq ss (ssget "_+.:E:S" '((0 . "INSERT") (66 . 1))))
        (foreach att (append (vlax-invoke (setq obj (vlax-ename->vla-object (ssname ss 0))) 'GetAttributes)
                             (vlax-invoke obj 'GetConstantAttributes))
          (if (eq tag (strcase (vla-get-TagString att)))
            (vlax-put att 'Invisible (~ (vlax-get att 'Invisible))))))
     
      (princ))
    All Blocks:
    Code:
     
    (defun c:am2 (/ tag ss sel)
      (vl-load-com)
     
      (setq tag "TAG1") ;; <<-- Tag to be Searched
     
      (and (setq ss (ssget "_X" '((0 . "INSERT") (66 . 1))))
           (vlax-for Obj (setq sel (vla-get-ActiveSelectionSet
                                     (vla-get-ActiveDocument (vlax-get-acad-object))))
              (foreach att (append (vlax-invoke Obj 'GetAttributes)
                                   (vlax-invoke Obj 'GetConstantAttributes))
                (if (eq tag (strcase (vla-get-TagString att)))
                  (vlax-put att 'Invisible (~ (vlax-get att 'Invisible))))))
           (vla-delete sel))
     
      (princ))

    AM1 & AM2 are nice codes... must read into them for I dont get it at all.
    Tnx for that.

    Now: sleep on the couch!

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,726

    Default

    Hi Marco,

    Had some time this afternoon, see the attached suits you, ddatte with visibility toggles

    Lee
    Attached Files
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  6. #6
    Super Member MarcoW's Avatar
    Computer Details
    MarcoW's Computer Details
    Operating System:
    Microsoft Windows 7 Pro 64-bit
    Computer:
    A black one
    CPU:
    Intel Xeon E5520 Quad Core
    RAM:
    8 GB
    Graphics:
    NVIDIA Quadro FX 580 - 512MB
    Primary Storage:
    300 GB 10000 RPM
    Using
    AutoCAD 2011
    Join Date
    Apr 2009
    Location
    The Netherlands
    Posts
    599

    Default

    Hi Lee,

    Thanks for this piece of code. It works like a charm and can be of great use.

    See ya around,
    Marco.

  7. #7
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,726

    Default

    Registered forum members do not see this ad.

    No worries Marco, I had fun making it
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

Similar Threads

  1. "Help" dialog opens when I start Cad
    By GliderRider in forum AutoCAD General
    Replies: 1
    Last Post: 25th May 2009, 09:43 pm
  2. "Open File" dialog is missing
    By russell84 in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 7th Mar 2008, 11:11 am
  3. Missing the "Open File" dialog box
    By siderus in forum AutoCAD Beginners' Area
    Replies: 7
    Last Post: 3rd Dec 2007, 03:08 pm
  4. Hide macro's in "VBARUN" Dialog
    By iTijn in forum AutoLISP, Visual LISP & DCL
    Replies: 2
    Last Post: 3rd Sep 2007, 09:29 am
  5. "Select File" Dialog Box MIA
    By KC in forum AutoCAD Drawing Management & Output
    Replies: 3
    Last Post: 20th Nov 2004, 03:44 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts