Jump to content
MarcoW

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

Recommended Posts

MarcoW

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.

Share this post


Link to post
Share on other sites
Lee Mac

This will make your Atts invisible:

 

(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

(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:

 
(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))

Share this post


Link to post
Share on other sites
MarcoW
This will make your Atts invisible:

 

(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

(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:

 
(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!

Share this post


Link to post
Share on other sites
Lee Mac

Hi Marco,

 

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

 

Lee

ddatte2.lsp

Share this post


Link to post
Share on other sites
MarcoW

Hi Lee,

 

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

 

See ya around,

Marco.

Share this post


Link to post
Share on other sites
Lee Mac

No worries Marco, I had fun making it :)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...