Give this a try:
Note that if val ("1:1000") is not included in the dynamic block's AllowedValues, no action is taken.Code:(defun c:FOO ( / ss dynProps val) (vl-load-com) (if (setq ss (ssget "_x" '((0 . "INSERT") (2 . "*DYN_LEGEND*")))) (progn (vla-startundomark (cond (*activeDoc*) ((setq *activeDoc* (vla-get-activedocument (vlax-get-acad-object)))))) (vlax-for x (setq ss (vla-get-activeselectionset *activeDoc*)) (if (and (= :vlax-true (vla-get-isdynamicblock x)) (vl-string-search "DYN_LEGEND" (strcase (vla-get-effectivename x))) (setq dynProps (car (vlax-invoke x 'getdynamicblockproperties))) (vl-position (cond (val) ((setq val "1:1000"))) (vlax-get dynProps 'allowedvalues))) (vlax-put-property dynProps 'value val))) (vla-endundomark *activeDoc*) (vla-delete ss)) (prompt "\n** Nothing selected ** ")) (princ))




Reply With Quote

Bookmarks