Tharwat Posted March 27, 2014 Share Posted March 27, 2014 OK! nice! Thank you! Sorry , to avoid running the routine on all Blocks in a drawing , I updated my reply before ( post # 18) , please change it as new and modify your quote with my reply . Thanks Quote Link to comment Share on other sites More sharing options...
flyfox1047 Posted March 27, 2014 Share Posted March 27, 2014 (defun c:tes1 ( / &doc &ss &cs #si #sn &s2 #i2 #n2 &c2 ) ;;;hide block (vl-load-com) (princ "\nSelect Blocks to hide all with the same name") (or &doc (setq &doc (vla-get-activedocument (vlax-get-acad-object)))) (if (setq &ss (ssget "_:L" '((0 . "INSERT")))) (repeat (setq #si -1 #sn (sslength &ss)) (setq &cs (vlax-ename->vla-object (ssname &ss (setq #si (1+ #si))))) (setq &s2 (ssget "_X" (list '(0 . "INSERT") (cons 2 (vla-get-name &cs))))) (repeat (setq #i2 -1 #n2 (sslength &s2)) (setq &c2 (vlax-ename->vla-object (ssname &s2 (setq #i2 (1+ #i2))))) (vl-catch-all-apply 'vla-put-visible (list &c2 :vlax-false)) ) ) ) (princ) ) (defun c:tes2 ( / &doc &ss &cs #si #sn &s2 #i2 #n2 &c2 ) ;;;display block (vl-load-com) (or &doc (setq &doc (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for &bl (vla-get-blocks &doc) (if (setq &ss (ssget "_X" (list '(0 . "INSERT") (cons 2 (vla-get-name &bl))))) (repeat (setq #si -1 #sn (sslength &ss)) (setq &cs (vlax-ename->vla-object (ssname &ss (setq #si (1+ #si))))) (if (= (vla-get-visible &cs) :vlax-false) (vl-catch-all-apply 'vla-put-visible (list &cs :vlax-true)) ) ) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
liuhaixin88 Posted March 27, 2014 Author Share Posted March 27, 2014 Sorry , to avoid running the routine on all Blocks in a drawing , I updated my reply before ( post # 18) , please change it as new and modify your quote with my reply . Thanks This? (defun c:hfxs (/ ss) (if (setq ss (ssget "x" '((0 . "INSERT")(60 . 1)))) (vlax-for obj (vla-get-activeselectionset (vla-get-activedocument (vlax-get-acad-object)) ) (vla-put-Visible obj :vlax-true) ) ) (princ) ) Quote Link to comment Share on other sites More sharing options...
liuhaixin88 Posted March 27, 2014 Author Share Posted March 27, 2014 (defun c:tes1 ( / &doc &ss &cs #si #sn &s2 #i2 #n2 &c2 ) ;;;hide block (vl-load-com) (princ "\nSelect Blocks to hide all with the same name") (or &doc (setq &doc (vla-get-activedocument (vlax-get-acad-object)))) (if (setq &ss (ssget "_:L" '((0 . "INSERT")))) (repeat (setq #si -1 #sn (sslength &ss)) (setq &cs (vlax-ename->vla-object (ssname &ss (setq #si (1+ #si))))) (setq &s2 (ssget "_X" (list '(0 . "INSERT") (cons 2 (vla-get-name &cs))))) (repeat (setq #i2 -1 #n2 (sslength &s2)) (setq &c2 (vlax-ename->vla-object (ssname &s2 (setq #i2 (1+ #i2))))) (vl-catch-all-apply 'vla-put-visible (list &c2 :vlax-false)) ) ) ) (princ) ) (defun c:tes2 ( / &doc &ss &cs #si #sn &s2 #i2 #n2 &c2 ) ;;;display block (vl-load-com) (or &doc (setq &doc (vla-get-activedocument (vlax-get-acad-object)))) (vlax-for &bl (vla-get-blocks &doc) (if (setq &ss (ssget "_X" (list '(0 . "INSERT") (cons 2 (vla-get-name &bl))))) (repeat (setq #si -1 #sn (sslength &ss)) (setq &cs (vlax-ename->vla-object (ssname &ss (setq #si (1+ #si))))) (if (= (vla-get-visible &cs) :vlax-false) (vl-catch-all-apply 'vla-put-visible (list &cs :vlax-true)) ) ) ) ) (princ) ) Good! so nice! thank you! flyfox1047:D Quote Link to comment Share on other sites More sharing options...
Tharwat Posted March 27, 2014 Share Posted March 27, 2014 This? Yes that 's it . Quote Link to comment Share on other sites More sharing options...
plecs Posted April 12, 2014 Share Posted April 12, 2014 (edited) sorry with bad argument type: fixnump: Edited April 14, 2014 by plecs Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.