Hi All
I am working with a drawing that has numerous of the same dynamic block. The block is called "UV(2)" and it has to dynamic actions - one to rotate the tag and another to rotate a group attributes that side to one side of the block. The action name that I want to rotate to zero is called "Angle2". Attached is a routine I found on the internet that I have modified but I cannot get to work. I keep getting the following error: "** Error: Automation Error. Invalid input **." I tried putting quotes around the rotation value but that doesn't make a difference. Ideally, I want to rotate the attribute values to zero for all blocks in the drawing. Thatnk you very much.
Manuel A. Ayala
Code:
(defun c:s2db (/ esb v vval sal salnth count)
(vl-load-com)
(setq esb nil)
(while (= esb nil)
(setq esb (entsel))
(if (/= (vlax-get-property (vlax-ename->vla-object (car esb)) "effectivename") "UV(2)")
(setq esb nil)
)
)
(setq obj (vlax-ename->vla-object (car esb)))
(setq v (vla-getdynamicblockproperties obj))
(setq vval (vlax-variant-value v))
(setq sal (vlax-safearray->list vval))
(setq salnth (length sal))
(setq count 0)
(while (< count salnth)
(if (= (vlax-get-property (nth count sal) "PropertyName") "Angle2")
(progn
(vlax-put-property (nth count sal) "Value" 0)(princ)
(setq count salnth)
)
(setq count (+ count 1))
)
)
(princ)
)