Question about Get Dynamic Block Visibility State - Lee Mac

Question about Get Dynamic Block Visibility State - Lee Mac

S_S_SS
Advocate Advocate
512 Views
2 Replies
Message 1 of 3

Question about Get Dynamic Block Visibility State - Lee Mac

S_S_SS
Advocate
Advocate

Hello every one  
I get this code from lee mac website 
can some one explain more about using this code
I have a block and it's name is "Sbeam 12 cm variable length
and I have a visibility parameter called "Visibility1"

and I need the lisp to give me the name of the visibility state of all of the blocks in a table 
I'll upload the DWG 

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

THANKS IN ADVANCE 

0 Likes
Accepted solutions (2)
513 Views
2 Replies
Replies (2)
Message 2 of 3

ВeekeeCZ
Consultant
Consultant
Accepted solution

@S_S_SS wrote:

Hello every one  
I get this code from lee mac website 
can some one explain more about using this code
I have a block and it's name is "Sbeam 12 cm variable length
and I have a visibility parameter called "Visibility1"

and I need the lisp to give me the name of the visibility state of all of the blocks in a table 
I'll upload the DWG 

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

THANKS IN ADVANCE 


 

Look at the code, do you really think that it's so simple?

The red are functions of which you need definitions.

Message 3 of 3

Sea-Haven
Mentor
Mentor
Accepted solution

A very quick answer

 

 

(setq ss (ssget (list (cons 0 "INSERT")(cons 2 "*u*"))))
(setq lst '())
(repeat (setq x (sslength ss))
(setq obj (vlax-ename->vla-object (ssname ss (setq x (1- x)))))
(setq lst (cons (list (vla-get-name obj)(LM:getvisibilitystate obj)) lst))
)

 

 make it a defun 

 

Does this mean have to redo the schedule of quantities again ? Private emails.