- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello to all:
I am trying to change a Visibility Parameter to a specified value for every block in a dwg (1 block attached). I've found this code from Lee Mac, but I'm not sure where to put in the values I need. The comment section shows what is what, but I can't figure out where in the code to substitute my specific, needed values. I've added them as comments below the code.
;; Set Dynamic Block Property Value - Lee Mac
;; Modifies the value of a Dynamic Block property (if present)
;; blk - [vla] VLA Dynamic Block Reference object
;; prp - [str] Dynamic Block property name (case-insensitive)
;; val - [any] New value for property
;; Returns: [any] New value if successful, else nil
(defun POSTSALE ( blk prp val )
(setq prp (strcase prp))
(vl-some
'(lambda ( x )
(if (= prp (strcase (vla-get-propertyname x)))
(progn
(vla-put-value x (vlax-make-variant val (vlax-variant-type (vla-get-value x))))
(cond (val) (t))
)
)
)
(vlax-invoke blk 'getdynamicblockproperties)
)
)
;;PROPERTY NAME IS: ADMIN_1
;;VALUE TO CHANGE TO IS: 1 ACCS-ON|PWR-ON|FPM-ON
There could be up to 150 differently-named blocks in any dwg I have to work with, but they will ALL have that Visibility Parameter and I need to change every block's visibility state to that value in the code. Can someone tell me where in the code I need to swap out for my needed data? Thanks in advance for any replies!
Solved! Go to Solution.