- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all.
I have been trying to write a program which takes the value of an existing dynamic block parameter and changes into a new one.
Lets say I have a rectangle block in my drawing named "Rectangle" which has two parameters ( named long and wide) and I want to change them from their actual state to a new value.
I have been searching and I found the below Lee Mac code, but I do not understand it so I can not implement it to my purpose. First I was trying to change blk prp into "Rectangle" "long" 200 (200 is the original length of the rectangle) but this obviously did not work: "too few arguments". I have been getting information about every function on this code but I cannot understand the full procedure of it all to adapt it to my purpose.
If someones please could tell me what I have been doing wrong or some information about the operations that the code is doing here it could be a great help.
Thanks!
;; 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 LM:setdynpropvalue ( 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) ) )
Solved! Go to Solution.