6
20
14
初来乍到
使用道具 举报
52
156
104
后起之秀
114
1万
中流砥柱
;; Retrieves All Properties from a Dynamic Block;; Args: obj ~ Dynamic Block VLA-Object;; Returns: ((<property name> <value>) ...)(defun GetDynProps (obj) ;; Lee Mac ~ 07.04.10 (mapcar (function (lambda (x / v) (list (vla-get-PropertyName x) (if (= 8192 (logand 8192 (vlax-variant-type (setq v (vla-get-value x))))) (vlax-safearray->list (vlax-variant-value v)) (vlax-variant-value v))))) (vlax-invoke obj 'GetDynamicBlockProperties)));; Retrieves All Properties from a Dynamic Block;; Args: obj ~ Dynamic Block VLA-Object;; Returns: ((<property name> <value>) ...)(defun GetDynProps (obj) ;; Lee Mac ~ 07.04.10 (mapcar (function (lambda (x) (list (vla-get-PropertyName x) (vlax-get x 'Value)))) (vlax-invoke obj 'GetDynamicBlockProperties)));; Changes a Dynamic Block Property Value;; Args: obj ~ Dynamic Block VLA-Object;; prop ~ Property Name;; val ~ New Value;; Returns: New Value (val)(defun PutDynPropValue (obj prop val) ;; Lee Mac ~ 07.04.10 (mapcar (function (lambda (x) (if (eq (strcase prop) (strcase (vla-get-propertyName x))) (vla-put-value x (vlax-make-variant val (vlax-variant-type (vla-get-value x))))))) (vlax-invoke obj 'GetDynamicBlockProperties)) val);; Retrieves the Allowed Values for a Specific Property;; Args: obj ~ Dynamic Block VLA-Object;; prop ~ Property Name;; Returns: List of Allowed Values (or nil)(defun GetPropAllowedValues (obj prop / a) ;; Lee Mac ~ 07.04.10 (mapcar (function (lambda (x / w) (if (eq (strcase prop) (strcase (vla-get-propertyName x))) (setq a (mapcar (function (lambda (v) (if (= 8192 (logand 8192 (vlax-variant-type v))) (vlax-safearray->list (vlax-variant-value v)) (vlax-variant-value v)))) (if (< 0 (vlax-safearray-get-u-bound (setq w (vlax-variant-value (vla-get-AllowedValues x))) 1)) (vlax-safearray->list w))))))) (vlax-invoke obj 'GetDynamicBlockProperties)) a);; Retrieves the Allowed Values for a Specific Property;; Args: obj ~ Dynamic Block VLA-Object;; prop ~ Property Name;; Returns: List of Allowed Values (or nil)(defun GetPropAllowedValues (obj prop / a) ;; Lee Mac ~ 07.04.10 (mapcar (function (lambda (x) (if (eq (strcase prop) (strcase (vla-get-propertyName x))) (setq a (vlax-get x 'AllowedValues))))) (vlax-invoke obj 'GetDynamicBlockProperties)) a);; Retrieves the Allowed Values for all Properties;; Args: obj ~ Dynamic Block VLA-Object;; Returns: ((<property name> (<Allowed Values>)) ...)(defun GetAllowedValues (obj) ;; Lee Mac ~ 07.04.10 (mapcar (function (lambda (x / w) (list (vla-get-propertyname x) (mapcar (function (lambda (v) (if (= 8192 (logand 8192 (vlax-variant-type v))) (vlax-safearray->list (vlax-variant-value v)) (vlax-variant-value v)))) (if (< 0 (vlax-safearray-get-u-bound (setq w (vlax-variant-value (vla-get-AllowedValues x))) 1)) (vlax-safearray->list w)))))) (vlax-invoke obj 'GetDynamicBlockProperties)));; Retrieves the Allowed Values for all Properties;; Args: obj ~ Dynamic Block VLA-Object;; Returns: ((<property name> (<Allowed Values>)) ...)