jetxcc Posted December 18, 2017 Share Posted December 18, 2017 (edited) Hello all, I've posted on SEVERAL forums trying to get an answer to this problem, I've compiled so many different Lisp routines that I've lost count, but none have quite been able to do what i want. i've attached a dwg with two blocks in it, the scope of what I'm trying to accomplish is at the bottom of this code: (defun BKVZ ( / blk idx obj sel vis ) (setq blk "WELD DETAIL" ;; Block Name vis "EQUAL WELD" ;; New Visibility State ) (if (setq sel (ssget "_X" (list '(0 . "INSERT") (cons 2 (strcat "`*U*," blk))))) (repeat (setq idx (sslength sel)) (if (= (strcase blk) (strcase (LM:blockname (setq obj (vlax-ename->vla-object (ssname sel (setq idx (1- idx)))))))) (LM:SetVisibilityState obj vis) ) ) ) (princ) ) ;; I would like the visibility state of several different dynamic blocks ;; to reference a text field within the drawing, and the blk variable to be used for several different dynamic ;; blocks within my drawing. for example in this drawing i have two dynamic blocks, and two text fields that ;; represent the visibility states that i want to use for the blocks (this value will change so i want to use it as a ;; variable to change the db viz prop) . I would like to be able to use this code to change the vis states of ;; several blocks within the same dwg, each of which would have a text field that will display the present vis state. ;; if i have to use setq blk1, blk2, blk3, etc to represent each block that is fine, but with several different possible ;; vis states, i would like that varible to reference the text field. so as the text field changes, so does the vis state of the ;; dynamic block. ANY HELP WOULD BE APPRECIATED. THANK YOU!! NEW-LISP-TRIAL.dwg Edited December 20, 2017 by SLW210 Quote Link to comment Share on other sites More sharing options...
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.