hosyn Posted July 30, 2020 Posted July 30, 2020 (edited) Are there any idea for select block and change visibilty for it in selection set of drawing by lisp?? Edited July 31, 2020 by hosyn Quote
ronjonp Posted July 31, 2020 Posted July 31, 2020 Use the filter command and then change the visibility in the properties palette. 1 Quote
hosyn Posted July 31, 2020 Author Posted July 31, 2020 Great, same as always thank you so muchhhhhh Are there any code lisp or function lisp for this propose ?? Quote
pkenewell Posted August 3, 2020 Posted August 3, 2020 Check this out: http://www.lee-mac.com/dynamicblockfunctions.html Quote
hosyn Posted August 3, 2020 Author Posted August 3, 2020 (edited) 3 hours ago, pkenewell said: Check this out: http://www.lee-mac.com/dynamicblockfunctions.html Hi I read the three useful visibility functions of professional lisp coder DEAR LEE MAC. Unfortunately i dont know how i can use the functions in this purpose ;; Get Visibility Parameter Name - Lee Mac ;; Returns the name of the Visibility Parameter of a Dynamic Block (if present) ;; blk - [vla] VLA Dynamic Block Reference object ;; Returns: [str] Name of Visibility Parameter, else nil ;(LM:getvisibilityparametername blk) ;(LM:getvisibilitystate blk) ;(LM:SetVisibilityState blk val ) (defun LM:getvisibilityparametername ( blk / vis ) (if (and (vlax-property-available-p blk 'effectivename) (setq blk (vla-item (vla-get-blocks (vla-get-document blk)) (vla-get-effectivename blk) ) ) (= :vlax-true (vla-get-isdynamicblock blk)) (= :vlax-true (vla-get-hasextensiondictionary blk)) (setq vis (vl-some '(lambda ( pair ) (if (and (= 360 (car pair)) (= "BLOCKVISIBILITYPARAMETER" (cdr (assoc 0 (entget (cdr pair))))) ) (cdr pair) ) ) (dictsearch (vlax-vla-object->ename (vla-getextensiondictionary blk)) "ACAD_ENHANCEDBLOCK" ) ) ) ) (cdr (assoc 301 (entget vis))) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Get Dynamic Block Visibility State - Lee Mac ;; Returns the value of the Visibility Parameter of a Dynamic Block (if present) ;; blk - [vla] VLA Dynamic Block Reference object ;; Returns: [str] Value of Visibility Parameter, else nil (defun LM:getvisibilitystate ( blk / vis ) (if (setq vis (LM:getvisibilityparametername blk)) (LM:getdynpropvalue blk vis) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Set Dynamic Block Visibility State - Lee Mac ;; Sets the Visibility Parameter of a Dynamic Block (if present) to a specific value (if allowed) ;; blk - [vla] VLA Dynamic Block Reference object ;; val - [str] Visibility State Parameter value ;; Returns: [str] New value of Visibility Parameter, else nil (defun LM:SetVisibilityState ( blk val / vis ) (if (and (setq vis (LM:getvisibilityparametername blk)) (member (strcase val) (mapcar 'strcase (LM:getdynpropallowedvalues blk vis))) ) (LM:setdynpropvalue blk vis val) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Effective Block Name - Lee Mac ;; obj - [vla] VLA Block Reference object ;(LM:effectivename ( obj )) (defun LM:effectivename ( obj ) (vlax-get-property obj (if (vlax-property-available-p obj 'effectivename) 'effectivename 'name ) ) ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Effective Block Name - Lee Mac ;; ent - [ent] Block Reference entity ;(LM:al-effectivename ent) (defun LM:al-effectivename ( ent / blk rep ) (if (wcmatch (setq blk (cdr (assoc 2 (entget ent)))) "`**") (if (and (setq rep (cdadr (assoc -3 (entget (cdr (assoc 330 (entget (tblobjname "block" blk) ) ) ) '("AcDbBlockRepBTag") ) ) ) ) (setq rep (handent (cdr (assoc 1005 rep)))) ) (setq blk (cdr (assoc 2 (entget rep)))) ) ) blk ) This is my trying to combine functions :: (LM:getvisibilityparametername (vla-get-effectivename (vlax-ename->vla-object (car (entsel "\nSelect block :"))))) Edited August 3, 2020 by hosyn Quote
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.