0 Members and 1 Guest are viewing this topic.
(defun c:reg (/ ent) (setq ent (car (entsel))) (LM:setdynpropvalue ent "SORT" "04") (princ));;-----------------------------------------------------------------------------------------------;; 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) ))