Hi all,
I'm working on a routine to insert dynamic blocks, and then change the flip state of the block from "not-flipped" to "flipped" however, I'm not grasping the information that I'm finding on the web about how to do it. If someone could look at this code and tell me (like I'm in kindergarten) where I'm going wrong, that would be great. The block gets inserted just fine, but then nothing else appears to be happening. Yes, I plagiarized most of this from Lee Mac... Thanks, Lee!
Code:
(defun c:test ( / obj );
(setq pt1 (getpoint "\nSelect insert location:\n"))
(command "insert" "30F" pt1 "" "" "");30F is name of dynamic block
(if (and (setq obj (entlast))
(= "AcDbBlockReference" (vla-get-objectname (setq obj (vlax-ename->vla-object obj))))
(= :vlax-true (vla-get-isdynamicblock obj))
)
(LM:setdynpropvalue obj "hrflip" 1)
)
(princ)
)
(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)
)
)
(vl-load-com)
(princ)