davide888 发表于 2013-9-23 10:31 
大神帮忙啊 数值类型好改了 像翻转及可见性没办法改啊
换个新的,这是别人的 - ;; Get Dynamic Block Property Value - Lee Mac
- ;; Returns the value of a Dynamic Block property (if present)
- ;; blk - [vla] VLA Dynamic Block Reference object
- ;; prp - [str] Dynamic Block property name (case-insensitive)
- (defun LM:getdynpropvalue ( blk prp )
- (setq prp (strcase prp))
- (vl-some '(lambda ( x ) (if (= prp (strcase (vla-get-propertyname x))) (vlax-get x 'value)))
- (vlax-invoke blk 'getdynamicblockproperties)
- )
- )
- ;; 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)
- )
- )
(LM:getdynpropvalue (vlax-ename->vla-object (car (entsel))) "门状态")
(LM:setdynpropvalue (vlax-ename->vla-object (car (entsel))) "门状态" "打开45度") |